/// <summary>Handler for when the start slideshow button is clicked</summary> private void startButton_Click(object sender, EventArgs e) { // Create a new slideshow form SlideshowForm slideForm = new SlideshowForm(); slideForm.Show(); // Create a new slideshow model Slideshow ss = new Slideshow(); slideForm.setSlideshow(ss); slideForm.setController(this); _slideShowForms.Add(slideForm); // add some pictures to the slideshow ss.addDirectory(folderBrowserDialog1.SelectedPath.ToString()); _slideshows.Add(ss); // Map slideshow forms to slideshows (views to models) _slideshowMap[slideForm] = ss; // get an enumerator for the slideshow. // This allows us to have a one-to-many slideshow-to-view relationship _slideshowIEMap[slideForm] = ss.GetEnumerator(); // Map an item in the list of slideshows to the slideshow itself // We need this to determine which slideshow the user wants to stop ListViewItem lvi = new ListViewItem(folderBrowserDialog1.SelectedPath.ToString(), 0); _lviToSlideshowFormMap[lvi] = slideForm; _SlideshowFormToLVIMap[slideForm] = lvi; slideShowListView.Items.Add(lvi); _slideshowIntervalMap[slideForm] = (uint)intervalNumericUpDown.Value; }
/// <summary>Set the Slideshow model for the Slideshow Form</summary> /// <param name="ss">The slideshow model</param> public void setSlideshow(Slideshow ss) { _slideshow = ss; }