/// <summary> /// This method opens the given slide in a new <see cref="SlideDesignModule"/> form /// for modification. /// </summary> /// <param name="treeNode">The <see cref="SlideshowTreeNode"/> that indicates the slide.</param> /// <param name="currentSlide">The <see cref="Slide"/> to be edited.</param> private void OpenSlideDesignForm(SlideshowTreeNode treeNode, Slide currentSlide) { SlideDesignModule newStimulusDesignForm = new SlideDesignModule(StimuliTypes.None); newStimulusDesignForm.Slide = (Slide)currentSlide.Clone(); this.OpenStimulusDesignerForm(newStimulusDesignForm, treeNode.Name); }
/// <summary> /// This method opens the given slide in a new <see cref="SlideDesignModule"/> form /// for modification. /// </summary> /// <param name="treeNode">The <see cref="SlideshowTreeNode"/> that indicates the slide.</param> /// <param name="currentSlide">The <see cref="Slide"/> to be edited.</param> private void OpenDesktopDesignForm(SlideshowTreeNode treeNode, Slide currentSlide) { DesktopDialog newDesktopDesignForm = new DesktopDialog(); newDesktopDesignForm.Slide = (Slide)currentSlide.Clone(); this.OpenDesktopDesignerForm(newDesktopDesignForm, treeNode.Name); }
public static Slide SaveSlideLevelChanges(this Slide slide, Slide other) { Slide clone = (Slide)other.Clone(); slide.LabelId = clone.LabelId; slide.Name = clone.Name; slide.Time = clone.Time; slide.Comment = clone.Comment; slide.Author = clone.Author; slide.Modified = clone.Modified; slide.DeviceList.Clear(); slide.DeviceList.AddRange(clone.DeviceList); slide.SourceList.Clear(); slide.SourceList.AddRange(clone.SourceList); slide.DisplayList.Clear(); slide.DisplayList.AddRange(clone.DisplayList); return slide; }
Slide CloneSlide(Slide from) { Slide result = (Slide)from.Clone(); result.IsLocked = false; result.State = SlideState.New; result.Id = GetNextSlideId(); result.Name = GetNextSlideName(); // логика вся переехала в Slide.Clone //https://sentinel2.luxoft.com/sen/issues/browse/PMEDIAINFOVISDEV-1194 //result.DisplayList.Clear(); //foreach (Display d in from.DisplayList) //{ // Display newDisplay = d.Type.CreateNewDisplay(); // result.DisplayList.Add(newDisplay); // foreach (Window w in d.WindowList) // { // newDisplay.WindowList.Add(w.SimpleClone()); // } //} //result.IsLocked = false; return result; }
/// <summary> /// This method loads the given slide content into the background of the /// <see cref="Picture"/>. If applicable any flash objects are /// initialized /// </summary> /// <param name="slide">The new <see cref="Slide"/> to be displayed in the /// background of the <see cref="Picture"/>.</param> /// <param name="activeXMode">The <see cref="ActiveXMode"/> that should /// be used to display slide and activeX controls. Use this /// to display them on top or in the background.</param> protected void LoadSlide(Slide slide, ActiveXMode activeXMode) { // This releases the resources of the used slide // including explicit disposing of flash objects this.Picture.ResetBackground(); if (slide == null) { return; } // Set presentation size slide.PresentationSize = Document.ActiveDocument.PresentationSize; if (slide.StimulusSize != Size.Empty) { this.Picture.StimulusSize = slide.StimulusSize; } else { this.Picture.StimulusSize = slide.PresentationSize; } this.Picture.PresentationSize = slide.PresentationSize; Slide slideCopy = (Slide)slide.Clone(); switch (activeXMode) { case ActiveXMode.Off: // set Pictures new background slide this.Picture.BgSlide = slideCopy; break; default: case ActiveXMode.BehindPicture: // set Pictures new background slide this.Picture.BgSlide = slideCopy; foreach (VGElement element in slideCopy.ActiveXStimuli) { if (element is VGFlash) { VGFlash flash = element as VGFlash; flash.InitializeOnControl(this.Picture.Parent, false, this.Picture.StimulusToScreen); } else if (element is VGBrowser) { // Don´t show browser control, use screenshot of whole website instead. // VGBrowser browser = element as VGBrowser; // browser.InitializeOnControl(this.Picture.Parent, false); } } break; case ActiveXMode.OnTop: // set Pictures new background slide this.Picture.BgSlide = slideCopy; foreach (VGElement element in slideCopy.ActiveXStimuli) { if (element is VGFlash) { VGFlash flash = element as VGFlash; flash.InitializeOnControl(this.Picture, false, this.Picture.StimulusToScreen); } else if (element is VGBrowser) { VGBrowser browser = element as VGBrowser; browser.InitializeOnControl(this.Picture, false); } } break; case ActiveXMode.Video: // Don´t use Slide this.Picture.BgSlide = null; break; } // Set autozoom, because websites could have changed in size this.AutoZoomPicture(); // Redraw picture this.Picture.Invalidate(); }