Ejemplo n.º 1
0
        private void app_SlideShowNextSlide(PP.SlideShowWindow Wn)
        {
            if (SlideIndexChanged == null)
            {
                return;
            }

            //logic to handle slideshow using timings reaching end, go to first slide of next slideshow
            if (Wn.View.State == PP.PpSlideShowState.ppSlideShowDone)
            {
                Slide slide = Slides.FirstOrDefault(s => s.PSlide == Wn.Presentation.Slides[Wn.Presentation.Slides.Count]);
                if (slide != null)
                {
                    app.SlideShowNextSlide -= new PP.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
                    //to change slideshow state from ppSlideShowDone so this method does not continuously run
                    Wn.View.Last();
                    //if first slide of next slideshow has timings, go to slide in order to reset timings to allow it to advance (view reset timings method seemed to have no effect)
                    if (Slides[slide.SlideIndex].PSlide != null)
                    {
                        GoTo(Slides[slide.SlideIndex]);
                    }
                    app.SlideShowNextSlide += new PP.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
                    Application.Current.Dispatcher.Invoke(new Action(() => { SlideIndexChanged(this, new SlideShowEventArgs(-1, slide.SlideIndex + 1)); }));
                }
            }
            else
            {
                Slide slide = Slides.FirstOrDefault(s => s.PSlide == Wn.View.Slide);
                if (slide != null)
                {
                    Application.Current.Dispatcher.Invoke(new Action(() => { SlideIndexChanged(this, new SlideShowEventArgs(-1, slide.SlideIndex)); }));
                }
            }
        }
Ejemplo n.º 2
0
 public Slide GetSlideById(string slideId)
 {
     return(Slides.FirstOrDefault(x => x.Id == slideId));
 }