private static void MatchTemplateTableWithSlides(AgendaTemplate template, List <PowerPointSlide> sectionSlides,
                                                         TemplateIndexTable templateTable, List <int> assignmentList, AgendaSection currentSection)
        {
            for (int i = 0; i < template.FrontSlidesCount; ++i)
            {
                SlidePurpose purpose = template.FrontSlides[i].SlidePurpose;
                for (int j = 0; j < assignmentList.Count; ++j)
                {
                    if (!AgendaSlide.MatchesPurpose(sectionSlides[j], purpose))
                    {
                        continue;
                    }
                    templateTable.FrontIndexes[i] = j;
                    AgendaSlide.SetSlideName(sectionSlides[j], template.Type, purpose, currentSection);
                    assignmentList[j] = TemplateIndexTable.Reserved;
                    break;
                }
            }

            for (int i = 0; i < template.BackSlidesCount; ++i)
            {
                SlidePurpose purpose = template.BackSlides[i].SlidePurpose;
                for (int j = 0; j < assignmentList.Count; ++j)
                {
                    if (!AgendaSlide.MatchesPurpose(sectionSlides[j], purpose))
                    {
                        continue;
                    }
                    templateTable.BackIndexes[i] = j;
                    AgendaSlide.SetSlideName(sectionSlides[j], template.Type, purpose, currentSection);
                    assignmentList[j] = TemplateIndexTable.Reserved;
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create the zoom in (drill down) effect in visual agenda. The zoom in slide is not part of the template.
        /// </summary>
        private static void GenerateVisualAgendaSlideZoomIn(PowerPointSlide slide, Shape zoomInShape)
        {
            PowerPointDrillDownSlide addedSlide;

            AutoZoom.AddDrillDownAnimation(zoomInShape, slide, out addedSlide, includeAckSlide: false, deletePreviouslyAdded: false);
            slide.GetShapesWithRule(new Regex("PPTZoomIn"))[0].Delete();
            AgendaSection section = AgendaSlide.Decode(slide).Section;

            AgendaSlide.SetSlideName(addedSlide, Type.Visual, SlidePurpose.ZoomIn, section);
            zoomInShape.Visible = MsoTriState.msoTrue;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create the zoom out (step back) effect in visual agenda. The zoom out slide is not part of the template.
        /// </summary>
        private static void GenerateVisualAgendaSlideZoomOut(PowerPointSlide slide, Shape zoomOutShape, bool finalZoomOut = false)
        {
            PowerPointStepBackSlide addedSlide;

            AutoZoom.AddStepBackAnimation(zoomOutShape, slide, out addedSlide, includeAckSlide: false, deletePreviouslyAdded: false);
            slide.GetShapesWithRule(new Regex("PPTZoomOut"))[0].Delete();
            AgendaSection section = AgendaSlide.Decode(slide).Section;

            AgendaSlide.SetSlideName(addedSlide, Type.Visual, finalZoomOut ? SlidePurpose.FinalZoomOut : SlidePurpose.ZoomOut, section);
            zoomOutShape.Visible = MsoTriState.msoTrue;

            var index = slide.Index;

            // move the step back slide to the first slide of the section
            PowerPointPresentation.Current.Presentation.Slides[index - 1].MoveTo(index);
            slide.MoveTo(index);
        }
        /// <summary>
        /// Returns a list of the newly added slides.
        /// Updates assignmentList (by appending)
        /// Gives placeholder agendaslide name to the created slides.
        /// </summary>
        private static List <PowerPointSlide> AddAllMissingSlides(ref int addToIndex, AgendaTemplate template,
                                                                  TemplateIndexTable templateTable, List <int> assignmentList, AgendaSection currentSection,
                                                                  int indexOfFirstBackSlide)
        {
            List <PowerPointSlide> createdSlides = new List <PowerPointSlide>();

            for (int i = 0; i < template.FrontSlidesCount; ++i)
            {
                if (templateTable.FrontIndexes[i] == TemplateIndexTable.NoSlide)
                {
                    PowerPointSlide newSlide = AddBlankSlide(addToIndex);
                    createdSlides.Add(newSlide);
                    AgendaSlide.SetSlideName(newSlide, template.Type, template.FrontSlides[i].SlidePurpose,
                                             currentSection);

                    templateTable.IsNewlyGeneratedFront[i] = true;
                    templateTable.FrontIndexes[i]          = assignmentList.Count;
                    assignmentList.Add(i);
                    addToIndex++;
                }
            }
            for (int i = 0; i < template.BackSlidesCount; ++i)
            {
                if (templateTable.BackIndexes[i] == TemplateIndexTable.NoSlide)
                {
                    PowerPointSlide newSlide = AddBlankSlide(addToIndex);
                    createdSlides.Add(newSlide);
                    AgendaSlide.SetSlideName(newSlide, template.Type, template.BackSlides[i].SlidePurpose,
                                             currentSection);

                    templateTable.IsNewlyGeneratedBack[i] = true;
                    templateTable.BackIndexes[i]          = assignmentList.Count;
                    assignmentList.Add(indexOfFirstBackSlide + i);
                    addToIndex++;
                }
            }

            return(createdSlides);
        }