private void editButton_Click(object sender, EventArgs e) { // Get the slide show for the current event SlideShow selectedShow = iEventList.GetSlideShow(eventsListBox.SelectedIndex); if (selectedShow == null) { int choice = eventsListBox.SelectedIndex; string choiceName = eventsListBox.Items[choice].ToString(); MessageBox.Show("Slide show for <" + choiceName + "> event cannot be edited"); } else { SlideShowEditor slideEditor = new SlideShowEditor(selectedShow); slideEditor.ShowDialog(); } }
void editToolStripMenuItem_Click(object sender, EventArgs e) { // It should only be possible to invoke the Edit menu item for an XML // file, but we will check to make sure ListView.SelectedListViewItemCollection selectedItems = this.listView.SelectedItems; if (selectedItems.Count == 1) { string filename = selectedItems[0].Text; if (IsXml(new FileInfo(filename))) { string currentDirectory = TreePath(treeView.SelectedNode); string filetype = Path.GetFileNameWithoutExtension(filename); if (filetype.Equals("album", StringComparison.CurrentCultureIgnoreCase)) { MessageBox.Show("Edit album: not implemented"); //AlbumForm albumForm = new AlbumForm(); //albumForm.LoadAlbum(currentDirectory); //albumForm.ShowDialog(); } else if (filetype.Equals("events", StringComparison.CurrentCultureIgnoreCase)) { MessageBox.Show("Edit event list: not implemented"); //EventsForm eventsForm = new EventsForm(); //eventsForm.LoadEvents(currentDirectory, filename); //eventsForm.ShowDialog(); } else { // Not an album nor an events page: must be a slide show SlideShowEditor slideEditor = new SlideShowEditor(); slideEditor.LoadShow(currentDirectory, filename); slideEditor.ShowDialog(); } } } }