コード例 #1
0
ファイル: A3Chapter.cs プロジェクト: alta3/PowerPointShell
 public A3Chapter(A3Slide slide)
 {
     Guid        = slide.Guid;
     HGuids      = slide.HGuids;
     Title       = slide.Title;
     Subchapters = new List <A3Subchapter>();
 }
コード例 #2
0
        private void BtnNextSlide_Click(object sender, EventArgs e)
        {
            int slideIndex = A3Environment.A3SLIDE.Slide.SlideIndex + 1;

            try { A3Slide.SetA3SlideFromPPTSlide(Globals.ThisAddIn.Application.ActivePresentation.Slides[slideIndex]); A3Environment.A3SLIDE.ReadShapes(); this.DrawSlideInfo(); }
            catch { MessageBox.Show("END OF SLIDE SHOW", "ERROR", MessageBoxButtons.OK); }
        }
コード例 #3
0
ファイル: A3Content.cs プロジェクト: alta3/PowerPointShell
 public A3Content(A3Slide slide)
 {
     Guid       = slide.Guid;
     HGuids     = slide.HGuids;
     Title      = slide.Title;
     Chapter    = slide.Chapter;
     Subchapter = slide.Subchapter;
     Type       = slide.Type.ToString();
     Notes      = slide.Notes;
     Index      = slide.Slide.SlideIndex;
 }
コード例 #4
0
        private (string name, string filename, bool haslabs, bool hasslides, bool hasvideos, string weburl) GetCourseInfo(A3Log log)
        {
            // Set the default values for the course info
            (string name, string filename, bool haslabs, bool hasslides, bool hasvideos, string weburl) = (null, null, false, false, false, null);

            // Find the course slide and log errors
            A3Slide course = GetCourse(log);

            // Split the notes section by the lines and then look for the specified metadata keys
            List <string> noteLines = new List <string>(course.Notes.Split(new string[] { Environment.NewLine }, StringSplitOptions.None));

            foreach (string line in noteLines)
            {
                List <string> map = new List <string>(line.Trim().Split(':'));
                if (Enum.TryParse(map[0].Remove('-').Trim().ToUpper(), out A3Outline.Metadata enumValue) && map.Count > 1)
                {
                    switch (enumValue)
                    {
                    case A3Outline.Metadata.NAME:
                        name = map[1];
                        break;

                    case A3Outline.Metadata.FILENAME:
                        filename = map[1];
                        break;

                    case A3Outline.Metadata.HASLABS:
                        try { haslabs = Convert.ToBoolean(map[1].ToLower()); }
                        catch { log.Write(A3Log.Level.Warn, "Failed to convert has-labs value to a boolean. -- Defaulting to false."); }
                        break;

                    case A3Outline.Metadata.HASSLIDES:
                        try { hasslides = Convert.ToBoolean(map[1].ToLower()); }
                        catch { log.Write(A3Log.Level.Warn, "Failed to convert has-slides value to a boolean. -- Defaulting to false."); }
                        break;

                    case A3Outline.Metadata.HASVIDEOS:
                        try { hasvideos = Convert.ToBoolean(map[1].ToLower()); }
                        catch { log.Write(A3Log.Level.Warn, "Failed to convert has-videos value to a boolean. -- Defaulting to false."); }
                        break;

                    case A3Outline.Metadata.WEBURL:
                        weburl = map[1];
                        break;
                    }
                }
            }
            return(name, filename, haslabs, hasslides, hasvideos, weburl);
        }
コード例 #5
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");
        }
コード例 #6
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();
        }
コード例 #7
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();
        }
コード例 #8
0
ファイル: A3Chapter.cs プロジェクト: alta3/PowerPointShell
        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);
                }
            }
        }
コード例 #9
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();
        }
コード例 #10
0
ファイル: A3Slide.cs プロジェクト: alta3/PowerPointShell
 public string FillSubchapter(A3Log log, A3Slide slide, string subchapter, int count)
 {
     switch (slide.Type)
     {
         case Types.CHAPTER:
             log.Write(A3Log.Level.Info, "Slide number {} was identified as a Chapter slide.".Replace("{}", count.ToString()));
             subchapter = "Contents";
             A3Environment.AFTER_CHAPTER = true;
             break;
         case Types.CONTENT:
             if (slide.Subchapter != subchapter && A3Environment.AFTER_CHAPTER)
             {
                 if (string.Equals(slide.Subchapter, "Contents"))
                 {
                     slide.Subchapter = subchapter;
                     slide.WriteTag(Tags.CHAPSUB);
                     log.Write(A3Log.Level.Info, "Slide number {N} was identified as a Content slide which has a unique subchapter name: {SC}, which has overwritten the current \"Contents\" subchapter name.".Replace("{N}", count.ToString()).Replace("{SC}", subchapter));
                 }
                 else
                 {
                     subchapter = slide.Subchapter;
                     log.Write(A3Log.Level.Info, "Slide number {N} was identified as a Content slide which has a new subchapter name: {SC}.".Replace("{N}", count.ToString()).Replace("{SC}", subchapter));
                 }
             }
             else
             {
                 log.Write(A3Log.Level.Info, "Slide number {N} was identified as a Content slide which matched the prvious subchapter: {SC}.".Replace("{N}", count.ToString()).Replace("{SC}", subchapter));
             }
             break;
         case Types.QUESTION:
             A3Environment.Clean();
             log.Write(A3Log.Level.Info, "Slide number {} was identified as a Question slide, no more slides will be parsed.".Replace("{}", count.ToString()));
             break;
     }
     return subchapter;
 }
コード例 #11
0
 public A3Subchapter(A3Slide slide)
 {
     Title  = slide.Subchapter;
     Slides = new List <A3Content>();
 }