public bool startSlideShow() { if (this.powerpoint == null) { return(false); } if (this.powerpoint.Presentations.Count == 0) { return(false); } stopSlideShow(); if (slides == null) { presentations = powerpoint.Presentations; presentation = presentations._Index(1); if (presentation != null) { slides = presentation.Slides; } } if (slides != null) { int all = slides.Count; int[] SlideIdx = new int[all]; for (int i = 0; i < all; i++) { SlideIdx[i] = i + 1; } slideRange = slides.Range(SlideIdx); slideShowTransition = slideRange.SlideShowTransition; slideShowTransition.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse; slideShowTransition.EntryEffect = Microsoft.Office.Interop.PowerPoint.PpEntryEffect.ppEffectBoxOut; //Prevent Office Assistant from displaying alert messages: //dumps if NotFiniteNumberException installed bAssistantOn = powerpoint.Assistant.On; // powerpoint.Assistant.On = false; //Run the Slide show slideShowSettings = presentation.SlideShowSettings; slideShowSettings.StartingSlide = 1; slideShowSettings.EndingSlide = all; slideShowWindow = slideShowSettings.Run(); slideShowWindows = powerpoint.SlideShowWindows; } return(true); }
public bool startSlideShow() { if (this.powerpoint == null) return false; if (this.powerpoint.Presentations.Count == 0) return false; stopSlideShow(); if (slides == null) { presentations = powerpoint.Presentations; presentation = presentations._Index(1); if (presentation != null) { slides = presentation.Slides; } } if (slides != null) { int all = slides.Count; int[] SlideIdx = new int[all]; for (int i = 0; i < all; i++) SlideIdx[i] = i + 1; slideRange = slides.Range(SlideIdx); slideShowTransition = slideRange.SlideShowTransition; slideShowTransition.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse; slideShowTransition.EntryEffect = Microsoft.Office.Interop.PowerPoint.PpEntryEffect.ppEffectBoxOut; //Prevent Office Assistant from displaying alert messages: //dumps if NotFiniteNumberException installed bAssistantOn = powerpoint.Assistant.On; // powerpoint.Assistant.On = false; //Run the Slide show slideShowSettings = presentation.SlideShowSettings; slideShowSettings.StartingSlide = 1; slideShowSettings.EndingSlide = all; slideShowWindow = slideShowSettings.Run(); slideShowWindows = powerpoint.SlideShowWindows; } return true; }
public SlideShow(BrowsablePointer item, uint interval_ms, bool init) : base() { this.item = item; DoubleBuffered = false; AppPaintable = true; CanFocus = true; item.Changed += HandleItemChanged; foreach (TransitionNode transition in AddinManager.GetExtensionNodes ("/FSpot/SlideShow")) { if (this.transition == null) this.transition = transition.Transition; transitions.Add (transition.Transition); } flip = new DelayedOperation (interval_ms, delegate {item.MoveNext (true); return true;}); animation = new DoubleAnimation (0, 1, new TimeSpan (0, 0, 2), HandleProgressChanged, GLib.Priority.Default); if (init) { HandleItemChanged (null, null); } }
private static void addSlideTimings(Slide slide, List <float> result) { SlideShowTransition sst = slide.SlideShowTransition; Sequence sequence = slide.TimeLine.MainSequence; float slideStart = 0f; if (result.Count > 0) { sst.Duration = defaultTransitionDuration; slideStart = result.Last() + defaultTransitionDuration; result.Add(slideStart); } if (sequence.Count > 0) { for (int i = 1; i <= sequence.Count; i++) { Effect effect = sequence[i]; Timing timing = effect.Timing; float animationDelay = timing.TriggerDelayTime; float animationDuration = timing.Duration; if (animationDelay <= 0) { animationDelay = defaultAnimationDelay; timing.TriggerDelayTime = defaultAnimationDelay; } if (animationDuration <= 0) { animationDuration = defaultAnimationDuration; timing.Duration = defaultAnimationDuration; } timing.TriggerType = MsoAnimTriggerType.msoAnimTriggerAfterPrevious; if (effect.EffectInformation.TextUnitEffect == MsoAnimTextUnitEffect.msoAnimTextUnitEffectByCharacter) { animationDuration = animationDuration * getCharactersCount(effect.DisplayName); } if (effect.EffectInformation.TextUnitEffect == MsoAnimTextUnitEffect.msoAnimTextUnitEffectByWord) { animationDuration = animationDuration * effect.DisplayName.Split(' ').Length; } float lastPoint = result.Count > 0 ? result.Last() : 0; result.Add(lastPoint + animationDelay + animationDuration); } } float currentPoint = result.Count > 0 ? result.Last() : 0; float averallAnimationDuration = currentPoint - slideStart; // 1 - transition time double actualSlideDuration = DEFAULT_SLIDE_DURATION * (Math.Floor((double)averallAnimationDuration / (double)DEFAULT_SLIDE_DURATION) + 1); // 5, 10, 15 ... sst.AdvanceOnTime = MsoTriState.msoTrue; sst.AdvanceOnClick = MsoTriState.msoFalse; sst.AdvanceTime = (float)actualSlideDuration; result.Add(slideStart + (float)actualSlideDuration); }