2011-07-04 01:57:18 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2011-07-04 02:50:38 +00:00
|
|
|
|
namespace BizHawk.MultiClient
|
2011-07-04 01:57:18 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class EditCommentsForm : Form
|
|
|
|
|
{
|
|
|
|
|
public bool ReadOnly;
|
|
|
|
|
private Movie selectedMovie = new Movie();
|
|
|
|
|
|
|
|
|
|
public EditCommentsForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void EditCommentsForm_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (ReadOnly)
|
|
|
|
|
{
|
|
|
|
|
CommentGrid.Columns[0].ReadOnly = true;
|
|
|
|
|
Text = "View Comments";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CommentGrid.Rows.Count > 8)
|
|
|
|
|
this.Height = Height + ((CommentGrid.Rows.Count - 8) * 21);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!ReadOnly)
|
|
|
|
|
{
|
2011-07-04 02:50:38 +00:00
|
|
|
|
for (int x = 0; x < CommentGrid.Rows.Count - 1; x++)
|
|
|
|
|
{
|
|
|
|
|
DataGridViewCell c = CommentGrid.Rows[x].Cells[0];
|
2011-07-04 13:31:34 +00:00
|
|
|
|
selectedMovie.AddComment("comment " + c.Value.ToString());
|
2011-07-04 02:50:38 +00:00
|
|
|
|
}
|
|
|
|
|
selectedMovie.WriteMovie();
|
2011-07-04 01:57:18 +00:00
|
|
|
|
}
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void GetMovie(Movie m)
|
|
|
|
|
{
|
|
|
|
|
selectedMovie = m;
|
|
|
|
|
List<string> comments = m.GetComments();
|
2011-07-04 13:31:34 +00:00
|
|
|
|
if (comments.Count == 0) return;
|
|
|
|
|
|
2011-07-04 02:50:38 +00:00
|
|
|
|
for (int x = 0; x < comments.Count; x++)
|
2011-07-04 01:57:18 +00:00
|
|
|
|
{
|
2011-07-04 13:31:34 +00:00
|
|
|
|
string str = comments[x];
|
|
|
|
|
if (str.Length >= 7 && str.Substring(0, 7) == "comment")
|
|
|
|
|
str = str.Remove(0, 7);
|
2011-07-04 02:50:38 +00:00
|
|
|
|
CommentGrid.Rows.Add();
|
2011-07-04 13:31:34 +00:00
|
|
|
|
DataGridViewCell c = CommentGrid.Rows[x].Cells[0];
|
|
|
|
|
|
|
|
|
|
c.Value = str;
|
2011-07-04 01:57:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|