public Form2(Video.MovieSection initialSection, string shortName) { InitializeComponent(); int numberOfItemsInEnum = Video.MovieSection.GetNames(typeof(Video.MovieSection)).Length; // Update the radio buttons for (int i = 0; i < kNumberOfRadios; i++) { if (i < numberOfItemsInEnum) { groupBox1.Controls[i].Text = Enum.GetNames(typeof(Video.MovieSection))[i].ToString(); } else { groupBox1.Controls[i].Text = "--------"; groupBox1.Controls[i].Enabled = false; } } (groupBox1.Controls[(int)initialSection] as RadioButton).Checked = true; if (FriendlyNames.Exists(shortName)) { textBox1.Text = FriendlyNames.Lookup(shortName); } else { textBox1.Text = String.Empty; } }
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Right && e.Node is VideoNode) { VideoNode clickedNode = e.Node as VideoNode; Video video = clickedNode.Video; //_context.Show(treeView1, e.Location); Rename rename = new Rename(video.VideoSection, video.ShortName, FriendlyNames.Lookup(video.ShortName)); rename.ShowDialog(); if (rename.DialogResult == DialogResult.OK) { FriendlyNames.Update(video.ShortName, rename.NewName); clickedNode.Text = rename.NewName; } } }
public VideoNode(Video video) { _video = video; Text = FriendlyNames.Lookup(video.ShortName);; Name = video.FullPath; }