예제 #1
0
        private void GenerateQuizSlide()
        {
            // Insert a question slide from the model PowerPoint
            Presentation.Slides[5].Duplicate().MoveTo(Presentation.Slides.Count);

            // Ensure the title is Knowledge Check and move on
            A3Slide slide = new A3Slide(Presentation.Slides[Presentation.Slides.Count])
            {
                Title = "Knowledge Check",
                Type  = A3Slide.Types.QUESTION,
                Guid  = Guid.NewGuid().ToString()
            };

            slide.WriteFromMemory();
            Presentation.SectionProperties.AddBeforeSlide(Presentation.Slides.Count, "Knowledge Check");
        }
예제 #2
0
        private void GenerateTOCSlide(string course)
        {
            // Insert a split slide from the model PowerPoint
            Presentation.Slides[4].Duplicate().MoveTo(Presentation.Slides.Count);

            // Populate the appropriate values of the slide deck here
            A3Slide slide = new A3Slide(Presentation.Slides[Presentation.Slides.Count])
            {
                Title      = "Table of Contents",
                Chapter    = course,
                Subchapter = "TOC",
                Type       = A3Slide.Types.TOC,
                Guid       = Guid.NewGuid().ToString()
            };

            slide.WriteFromMemory();
        }
예제 #3
0
        private void GenerateEndOfDeckSlide(string course)
        {
            // Insert a title slide from the model PowerPoint
            Presentation.Slides[3].Duplicate().MoveTo(Presentation.Slides.Count);

            // Change the title, chapsub, type, and active guid to accurately reflect what is happening
            A3Slide slide = new A3Slide(Presentation.Slides[Presentation.Slides.Count])
            {
                Title      = "End of Deck",
                Chapter    = course,
                Subchapter = "End of Deck",
                Guid       = Guid.NewGuid().ToString(),
                Type       = A3Slide.Types.CONTENT
            };

            slide.WriteFromMemory();
        }
예제 #4
0
        private void WriteChapterSlide(Presentation presentation)
        {
            // Open the appropriate slide and set it to the active slide in the presentation
            presentation.Slides[2].Duplicate().MoveTo(presentation.Slides.Count);

            // Change the title of the slide and the scrubber to accurately reflect the outline
            A3Slide slide = new A3Slide(presentation.Slides[presentation.Slides.Count])
            {
                Type    = A3Slide.Types.CHAPTER,
                Chapter = "Vocabluary",
                Title   = Title,
                Guid    = System.Guid.NewGuid().ToString()
            };

            slide.WriteFromMemory();

            Shape toc = slide.GetShapeByTag(A3Slide.Tags.TOC);

            toc.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink.Address    = null;
            toc.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink.SubAddress = null;
            toc.TextFrame.TextRange.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink.Address    = null;
            toc.TextFrame.TextRange.ActionSettings[PpMouseActivation.ppMouseClick].Hyperlink.SubAddress = presentation.Slides[2].SlideID + "," + presentation.Slides[2].SlideIndex + "," + presentation.Slides[2].Name;

            try
            {
                foreach (Microsoft.Vbe.Interop.VBComponent component in presentation.VBProject.VBComponents)
                {
                    if (component.Name.ToLower().StartsWith("slide"))
                    {
                        component.CodeModule.AddFromString(A3Environment.CHAPTER_VBA);
                    }
                }
            }
            catch
            {
                if (A3Environment.QUIT_FROM_CURRENT_LOOP is false)
                {
                    MessageBox.Show("You must give access to the VBA Object Model for this plugin to work: \r\n File -> Options -> Trust Center -> Trust Center Setttings -> Macro Settings -> Trust Access to the VBA Project object model. This build will fail.", "Security Setting Problem", MessageBoxButtons.OK);
                }
            }
        }
예제 #5
0
        private void GenerateCourseSlide(string title, string filename, bool haslabs, bool hasslides, bool hasvideos, string weburl)
        {
            // Insert the course slide from the model PowerPoint
            Presentation.Slides[1].Duplicate().MoveTo(Presentation.Slides.Count);

            // Change the title to the course title given in the yaml file
            A3Slide course = new A3Slide(Presentation.Slides[Presentation.Slides.Count])
            {
                Title = title,
                Type  = A3Slide.Types.COURSE,
                Guid  = Guid.NewGuid().ToString(),
                Notes = string.Concat("name: ", title,
                                      "\r\nfilename: ", filename,
                                      "\r\nhas-labs: ", haslabs.ToString(),
                                      "\r\nhas-slides: ", hasslides.ToString(),
                                      "\r\nhas-videos: ", hasvideos.ToString(),
                                      "\r\nweburl: ", weburl)
            };

            course.WriteFromMemory();
        }