Exemplo n.º 1
0
        /// <summary>
        /// Scrambles the slide section names to avoid duplicate names later on, which can crash powerpoint.
        /// Use this just before reassigning the slide section names! Don't keep the slide names this way!
        /// </summary>
        private static void ScrambleSlideSectionNames()
        {
            var slides = PowerPointPresentation.Current.Slides;

            slides.Where(slide => AgendaSlide.IsAnyAgendaSlide(slide) && AgendaSlide.IsNotReferenceslide(slide))
            .ToList()
            .ForEach(AgendaSlide.AssignUniqueSectionName);
        }
Exemplo n.º 2
0
        private static void SyncBeamOnSlides(List <PowerPointSlide> targetSlides, PowerPointSlide refSlide)
        {
            var syncSlides = new List <PowerPointSlide>();

            // Generate beam agenda for all target slides that do not currently have the beam agenda.
            if (targetSlides != null)
            {
                var selectedSlidesWithoutBeam = targetSlides.Where(slide => !HasBeamShape(slide));
                syncSlides.AddRange(selectedSlidesWithoutBeam);
            }

            // Synchronise agenda for all slides in the presentation that have the beam agenda.
            var refBeamShape      = FindBeamShape(refSlide);
            var allSlidesWithBeam = PowerPointPresentation.Current.Slides
                                    .Where(slide => AgendaSlide.IsNotReferenceslide(slide) &&
                                           FindBeamShape(slide) != null);

            syncSlides.AddRange(allSlidesWithBeam);

            foreach (var slide in syncSlides)
            {
                UpdateBeamOnSlide(slide, refBeamShape);
            }
        }