Esempio n. 1
0
        public static void Sample(this IPointContext ctx)
        {
            var p = ((PointContext)ctx).P;

            var slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId {
                Id = 2147483648U, RelationshipId = "rId1"
            });
            var slideIdList1 = new SlideIdList(new SlideId {
                Id = 256U, RelationshipId = "rId2"
            });
            var slideSize1 = new SlideSize {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            var notesSize1 = new NotesSize {
                Cx = 6858000, Cy = 9144000
            };
            var defaultTextStyle1 = new DefaultTextStyle();

            p.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            var slidePart1       = CreateSlidePart(p);
            var slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            var slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            var themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            p.AddPart(slideMasterPart1, "rId1");
            p.AddPart(themePart1, "rId5");
        }
        public List <PPTSlide> GetPPTSlides(string pathToPresentation)
        {
            string fileFromPath = Path.GetFileName(pathToPresentation);
            var    inf          = new FileInfo(fileFromPath);
            string fileName     = Path.GetFileNameWithoutExtension(inf.Name);

            string dir     = Path.GetDirectoryName(Path.GetDirectoryName(Environment.CurrentDirectory));
            string destDir = Path.Combine(dir, Globals.STORAGE_DIR);

            PresentationDocument presentationDocument = null;

            try
            {
                presentationDocument = PresentationDocument.Open(pathToPresentation, false);
                //get the slide sizes.
                Presentation presentation = presentationDocument.PresentationPart.Presentation;
                SlideSizes = presentation.SlideSize;
            }
            catch (Exception ex)
            {
                throw new FileNotFoundException(
                          "PPTPresenationController.Ctor Unable to open Power Point Presentation.Path - "
                          + pathToPresentation, ex.InnerException);
            }
            if (presentationDocument == null)
            {
                throw new ArgumentNullException("Presentation Document missing");
            }
            IEnumerable <SlidePart> slideParts = GetPresentationSlideParts(presentationDocument);

            preserveWhitespaces(slideParts);//bug fix; whitespaces in separate runs are not preserved

            List <PPTSlide> pptSlides = GetPPTSlidesFromParts(slideParts, presentationDocument.PresentationPart.Presentation.DefaultTextStyle, fileName);

            presentationDocument.Close();
            List <PPTImage> pictures = new List <PPTImage>();

            foreach (PPTSlide slide in pptSlides)
            {
                foreach (PPTShapeBase baseShape in slide.ContainerShape.Elements)
                {
                    if (typeof(PPTImage).Equals(baseShape.GetType()))
                    {
                        pictures.Add((PPTImage)baseShape);
                    }
                }
            }



            var pptInteropt = new PPTBackgroundBuilderInterop(pathToPresentation, pictures);

            pptInteropt.ExportPresentationImages(destDir);
            pptInteropt = null;
            GC.Collect();



            return(pptSlides);
        }
Esempio n. 3
0
 public static SlideFormatEnum GetFormatBySlideSize(SlideSize slideSize)
 {
     return(_availableFormats
            .Where(f => f.SupportedSizes
                   .Any(supportedSize => supportedSize.Width == slideSize.Width &&
                        supportedSize.Height == slideSize.Height))
            .Select(f => f.Id)
            .FirstOrDefault());
 }
Esempio n. 4
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;

            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");

            // Start set layout.

            /*
             * string layoutName = "Title and Content";
             *
             * // Get SlideMasterPart and SlideLayoutPart from the existing Presentation Part
             * SlideMasterPart slideMasterPart = presentationPart.SlideMasterParts.First();
             * SlideLayoutPart slideLayoutPart = slideMasterPart.SlideLayoutParts.SingleOrDefault
             *  (sl => sl.SlideLayout.CommonSlideData.Name.Value.Equals(layoutName, StringComparison.OrdinalIgnoreCase));
             * if (slideLayoutPart == null)
             * {
             *  throw new Exception("The slide layout " + layoutName + " is not found");
             * }
             *
             * slidePart1.AddPart<SlideLayoutPart>(slideLayoutPart);
             */
            // End set layout.
        }
Esempio n. 5
0
        private void insert(PresentationPart presentationPart, List <String> imgList)
        {
            int  idx        = 1;
            uint uid        = UInt32.MaxValue;
            var  slideParts = presentationPart.SlideParts;

            string            slideMasterRid    = "rId" + idx;
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = uid, RelationshipId = slideMasterRid
            });
            SlideIdList slideIdList = new SlideIdList();
            SlideSize   slideSize   = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlideLayoutPart layoutPart = null;
            SlideMasterPart masterPart = null;
            ThemePart       themePart  = null;

            foreach (string imgPath in imgList)
            {
                String imgIdx   = "rId" + (900 + idx);
                String slideIdx = "rId" + (idx + 1);
                String themeIdx = "rId" + (idx + 4);

                var slidePart = CreateSlidePart(presentationPart, slideIdx, uid = uid - 10);
                if (null == layoutPart)
                {
                    layoutPart = CreateSlideLayoutPart(slidePart, slideMasterRid, uid = uid - 10);
                    masterPart = CreateSlideMasterPart(layoutPart, slideMasterRid, uid = uid - 10);
                    themePart  = CreateTheme(masterPart, themeIdx);
                    masterPart.AddPart(layoutPart, slideMasterRid);
                    presentationPart.AddPart(masterPart, slideMasterRid);
                    presentationPart.AddPart(themePart, themeIdx);
                }

                //insert(slidePart, imgPath, imgIdx, uid = uid - 10);
                idx += 5;
            }
            presentationPart.Presentation.Save();
        }
        private static void CreatePresentationTempalte(PresentationPart presentationPart)
        {
            // create template pptx
            SlideMasterIdList slideMasterIdList = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = slideMasterRId
            });
            SlideIdList slideIdList = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = slidePartRId
            });
            SlideSize slideSize = new SlideSize()
            {
                Cx = slideCx, Cy = slideCy, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize = new NotesSize()
            {
                Cx = slideCy, Cy = slideCx
            };
            DefaultTextStyle defaultTextStyle = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList, slideIdList, slideSize, notesSize, defaultTextStyle);

            SlidePart       templateSlidePart;
            SlideLayoutPart slideLayoutPart;
            SlideMasterPart slideMasterPart;
            ThemePart       themePart;


            templateSlidePart = CreateSlidePart(presentationPart);
            slideLayoutPart   = CreateSlideLayoutPart(templateSlidePart);
            slideMasterPart   = CreateSlideMasterPart(slideLayoutPart);
            themePart         = CreateTheme(slideMasterPart);

            slideMasterPart.AddPart(slideLayoutPart, slideMasterRId);
            presentationPart.AddPart(slideMasterPart, slideMasterRId);
            presentationPart.AddPart(themePart, themPartRId);
        }
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000, Cy = 9144000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateSlidePart(presentationPart);
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
Esempio n. 8
0
        private static void CreatePresentationParts(PresentationPart presentationPart)
        {
            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList(new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            });
            SlideIdList slideIdList1 = new SlideIdList(new SlideId()
            {
                Id = (DocumentFormat.OpenXml.UInt32Value) 256U, RelationshipId = "rId2"
            });
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 12192000, Cy = 6858000
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cy = 6858000, Cx = 12192000
            };
            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            presentationPart.Presentation.Append(slideMasterIdList1, slideIdList1, slideSize1, notesSize1, defaultTextStyle1);

            SlidePart       slidePart1;
            SlideLayoutPart slideLayoutPart1;
            SlideMasterPart slideMasterPart1;
            ThemePart       themePart1;


            slidePart1       = CreateAddSlidePart(presentationPart, "rId2");
            slideLayoutPart1 = CreateSlideLayoutPart(slidePart1);
            slideMasterPart1 = CreateSlideMasterPart(slideLayoutPart1);
            themePart1       = CreateTheme(slideMasterPart1);

            slideMasterPart1.AddPart(slideLayoutPart1, "rId1");
            presentationPart.AddPart(slideMasterPart1, "rId1");
            presentationPart.AddPart(themePart1, "rId5");
        }
Esempio n. 9
0
        private void GeneratePresentationPart1Content_16x9(PresentationPart presentationPart1)
        {
            Presentation presentation1 = new Presentation()
            {
                SaveSubsetFonts = true
            };

            presentation1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentation1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentation1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList();
            SlideMasterId     slideMasterId1     = new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId1"
            };

            slideMasterIdList1.Append(slideMasterId1);

            SlideIdList slideIdList1 = new SlideIdList();
            SlideId     slideId1     = new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            };

            slideIdList1.Append(slideId1);
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 12192000, Cy = 6858000
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000L, Cy = 9144000L
            };

            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            A.DefaultParagraphProperties defaultParagraphProperties1 = new A.DefaultParagraphProperties();
            A.DefaultRunProperties       defaultRunProperties1       = new A.DefaultRunProperties()
            {
                Language = "ja-JP"
            };

            defaultParagraphProperties1.Append(defaultRunProperties1);

            A.Level1ParagraphProperties level1ParagraphProperties1 = new A.Level1ParagraphProperties()
            {
                LeftMargin = 0, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties2 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill1   = new A.SolidFill();
            A.SchemeColor schemeColor1 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill1.Append(schemeColor1);
            A.LatinFont latinFont1 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont1 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont1 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties2.Append(solidFill1);
            defaultRunProperties2.Append(latinFont1);
            defaultRunProperties2.Append(eastAsianFont1);
            defaultRunProperties2.Append(complexScriptFont1);

            level1ParagraphProperties1.Append(defaultRunProperties2);

            A.Level2ParagraphProperties level2ParagraphProperties1 = new A.Level2ParagraphProperties()
            {
                LeftMargin = 457200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties3 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill2   = new A.SolidFill();
            A.SchemeColor schemeColor2 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill2.Append(schemeColor2);
            A.LatinFont latinFont2 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont2 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont2 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties3.Append(solidFill2);
            defaultRunProperties3.Append(latinFont2);
            defaultRunProperties3.Append(eastAsianFont2);
            defaultRunProperties3.Append(complexScriptFont2);

            level2ParagraphProperties1.Append(defaultRunProperties3);

            A.Level3ParagraphProperties level3ParagraphProperties1 = new A.Level3ParagraphProperties()
            {
                LeftMargin = 914400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties4 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill3   = new A.SolidFill();
            A.SchemeColor schemeColor3 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill3.Append(schemeColor3);
            A.LatinFont latinFont3 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont3 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont3 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties4.Append(solidFill3);
            defaultRunProperties4.Append(latinFont3);
            defaultRunProperties4.Append(eastAsianFont3);
            defaultRunProperties4.Append(complexScriptFont3);

            level3ParagraphProperties1.Append(defaultRunProperties4);

            A.Level4ParagraphProperties level4ParagraphProperties1 = new A.Level4ParagraphProperties()
            {
                LeftMargin = 1371600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties5 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill4   = new A.SolidFill();
            A.SchemeColor schemeColor4 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill4.Append(schemeColor4);
            A.LatinFont latinFont4 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont4 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont4 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties5.Append(solidFill4);
            defaultRunProperties5.Append(latinFont4);
            defaultRunProperties5.Append(eastAsianFont4);
            defaultRunProperties5.Append(complexScriptFont4);

            level4ParagraphProperties1.Append(defaultRunProperties5);

            A.Level5ParagraphProperties level5ParagraphProperties1 = new A.Level5ParagraphProperties()
            {
                LeftMargin = 1828800, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties6 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill5   = new A.SolidFill();
            A.SchemeColor schemeColor5 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill5.Append(schemeColor5);
            A.LatinFont latinFont5 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont5 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont5 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties6.Append(solidFill5);
            defaultRunProperties6.Append(latinFont5);
            defaultRunProperties6.Append(eastAsianFont5);
            defaultRunProperties6.Append(complexScriptFont5);

            level5ParagraphProperties1.Append(defaultRunProperties6);

            A.Level6ParagraphProperties level6ParagraphProperties1 = new A.Level6ParagraphProperties()
            {
                LeftMargin = 2286000, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties7 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill6   = new A.SolidFill();
            A.SchemeColor schemeColor6 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill6.Append(schemeColor6);
            A.LatinFont latinFont6 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont6 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont6 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties7.Append(solidFill6);
            defaultRunProperties7.Append(latinFont6);
            defaultRunProperties7.Append(eastAsianFont6);
            defaultRunProperties7.Append(complexScriptFont6);

            level6ParagraphProperties1.Append(defaultRunProperties7);

            A.Level7ParagraphProperties level7ParagraphProperties1 = new A.Level7ParagraphProperties()
            {
                LeftMargin = 2743200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties8 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill7   = new A.SolidFill();
            A.SchemeColor schemeColor7 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill7.Append(schemeColor7);
            A.LatinFont latinFont7 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont7 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont7 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties8.Append(solidFill7);
            defaultRunProperties8.Append(latinFont7);
            defaultRunProperties8.Append(eastAsianFont7);
            defaultRunProperties8.Append(complexScriptFont7);

            level7ParagraphProperties1.Append(defaultRunProperties8);

            A.Level8ParagraphProperties level8ParagraphProperties1 = new A.Level8ParagraphProperties()
            {
                LeftMargin = 3200400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties9 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill8   = new A.SolidFill();
            A.SchemeColor schemeColor8 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill8.Append(schemeColor8);
            A.LatinFont latinFont8 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont8 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont8 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties9.Append(solidFill8);
            defaultRunProperties9.Append(latinFont8);
            defaultRunProperties9.Append(eastAsianFont8);
            defaultRunProperties9.Append(complexScriptFont8);

            level8ParagraphProperties1.Append(defaultRunProperties9);

            A.Level9ParagraphProperties level9ParagraphProperties1 = new A.Level9ParagraphProperties()
            {
                LeftMargin = 3657600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties10 = new A.DefaultRunProperties()
            {
                Kumimoji = true, FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill9   = new A.SolidFill();
            A.SchemeColor schemeColor9 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill9.Append(schemeColor9);
            A.LatinFont latinFont9 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont9 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont9 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties10.Append(solidFill9);
            defaultRunProperties10.Append(latinFont9);
            defaultRunProperties10.Append(eastAsianFont9);
            defaultRunProperties10.Append(complexScriptFont9);

            level9ParagraphProperties1.Append(defaultRunProperties10);

            defaultTextStyle1.Append(defaultParagraphProperties1);
            defaultTextStyle1.Append(level1ParagraphProperties1);
            defaultTextStyle1.Append(level2ParagraphProperties1);
            defaultTextStyle1.Append(level3ParagraphProperties1);
            defaultTextStyle1.Append(level4ParagraphProperties1);
            defaultTextStyle1.Append(level5ParagraphProperties1);
            defaultTextStyle1.Append(level6ParagraphProperties1);
            defaultTextStyle1.Append(level7ParagraphProperties1);
            defaultTextStyle1.Append(level8ParagraphProperties1);
            defaultTextStyle1.Append(level9ParagraphProperties1);

            PresentationExtensionList presentationExtensionList1 = new PresentationExtensionList();

            PresentationExtension presentationExtension1 = new PresentationExtension()
            {
                Uri = "{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"
            };

            P15.SlideGuideList slideGuideList1 = new P15.SlideGuideList();
            slideGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            presentationExtension1.Append(slideGuideList1);

            presentationExtensionList1.Append(presentationExtension1);

            presentation1.Append(slideMasterIdList1);
            presentation1.Append(slideIdList1);
            presentation1.Append(slideSize1);
            presentation1.Append(notesSize1);
            presentation1.Append(defaultTextStyle1);
            presentation1.Append(presentationExtensionList1);

            presentationPart1.Presentation = presentation1;
        }
Esempio n. 10
0
        // Generates content of part.
        private void GeneratePartContent_4x3(PresentationPart part)
        {
            Presentation presentation1 = new Presentation()
            {
                SaveSubsetFonts = true
            };

            presentation1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentation1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentation1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList();
            SlideMasterId     slideMasterId1     = new SlideMasterId()
            {
                Id = (UInt32Value)2147483660U, RelationshipId = "rId1"
            };

            slideMasterIdList1.Append(slideMasterId1);

            SlideIdList slideIdList1 = new SlideIdList();
            SlideId     slideId1     = new SlideId()
            {
                Id = (UInt32Value)256U, RelationshipId = "rId2"
            };

            slideIdList1.Append(slideId1);
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9144000, Cy = 6858000, Type = SlideSizeValues.Screen4x3
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6858000L, Cy = 9144000L
            };

            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            A.DefaultParagraphProperties defaultParagraphProperties2 = new A.DefaultParagraphProperties();
            A.DefaultRunProperties       defaultRunProperties100     = new A.DefaultRunProperties()
            {
                Language = "en-US"
            };

            defaultParagraphProperties2.Append(defaultRunProperties100);

            A.Level1ParagraphProperties level1ParagraphProperties19 = new A.Level1ParagraphProperties()
            {
                LeftMargin = 0, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties101 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill38   = new A.SolidFill();
            A.SchemeColor schemeColor48 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill38.Append(schemeColor48);
            A.LatinFont latinFont22 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont22 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont22 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties101.Append(solidFill38);
            defaultRunProperties101.Append(latinFont22);
            defaultRunProperties101.Append(eastAsianFont22);
            defaultRunProperties101.Append(complexScriptFont22);

            level1ParagraphProperties19.Append(defaultRunProperties101);

            A.Level2ParagraphProperties level2ParagraphProperties11 = new A.Level2ParagraphProperties()
            {
                LeftMargin = 457200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties102 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill39   = new A.SolidFill();
            A.SchemeColor schemeColor49 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill39.Append(schemeColor49);
            A.LatinFont latinFont23 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont23 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont23 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties102.Append(solidFill39);
            defaultRunProperties102.Append(latinFont23);
            defaultRunProperties102.Append(eastAsianFont23);
            defaultRunProperties102.Append(complexScriptFont23);

            level2ParagraphProperties11.Append(defaultRunProperties102);

            A.Level3ParagraphProperties level3ParagraphProperties11 = new A.Level3ParagraphProperties()
            {
                LeftMargin = 914400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties103 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill40   = new A.SolidFill();
            A.SchemeColor schemeColor50 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill40.Append(schemeColor50);
            A.LatinFont latinFont24 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont24 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont24 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties103.Append(solidFill40);
            defaultRunProperties103.Append(latinFont24);
            defaultRunProperties103.Append(eastAsianFont24);
            defaultRunProperties103.Append(complexScriptFont24);

            level3ParagraphProperties11.Append(defaultRunProperties103);

            A.Level4ParagraphProperties level4ParagraphProperties11 = new A.Level4ParagraphProperties()
            {
                LeftMargin = 1371600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties104 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill41   = new A.SolidFill();
            A.SchemeColor schemeColor51 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill41.Append(schemeColor51);
            A.LatinFont latinFont25 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont25 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont25 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties104.Append(solidFill41);
            defaultRunProperties104.Append(latinFont25);
            defaultRunProperties104.Append(eastAsianFont25);
            defaultRunProperties104.Append(complexScriptFont25);

            level4ParagraphProperties11.Append(defaultRunProperties104);

            A.Level5ParagraphProperties level5ParagraphProperties11 = new A.Level5ParagraphProperties()
            {
                LeftMargin = 1828800, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties105 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill42   = new A.SolidFill();
            A.SchemeColor schemeColor52 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill42.Append(schemeColor52);
            A.LatinFont latinFont26 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont26 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont26 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties105.Append(solidFill42);
            defaultRunProperties105.Append(latinFont26);
            defaultRunProperties105.Append(eastAsianFont26);
            defaultRunProperties105.Append(complexScriptFont26);

            level5ParagraphProperties11.Append(defaultRunProperties105);

            A.Level6ParagraphProperties level6ParagraphProperties11 = new A.Level6ParagraphProperties()
            {
                LeftMargin = 2286000, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties106 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill43   = new A.SolidFill();
            A.SchemeColor schemeColor53 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill43.Append(schemeColor53);
            A.LatinFont latinFont27 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont27 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont27 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties106.Append(solidFill43);
            defaultRunProperties106.Append(latinFont27);
            defaultRunProperties106.Append(eastAsianFont27);
            defaultRunProperties106.Append(complexScriptFont27);

            level6ParagraphProperties11.Append(defaultRunProperties106);

            A.Level7ParagraphProperties level7ParagraphProperties11 = new A.Level7ParagraphProperties()
            {
                LeftMargin = 2743200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties107 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill44   = new A.SolidFill();
            A.SchemeColor schemeColor54 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill44.Append(schemeColor54);
            A.LatinFont latinFont28 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont28 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont28 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties107.Append(solidFill44);
            defaultRunProperties107.Append(latinFont28);
            defaultRunProperties107.Append(eastAsianFont28);
            defaultRunProperties107.Append(complexScriptFont28);

            level7ParagraphProperties11.Append(defaultRunProperties107);

            A.Level8ParagraphProperties level8ParagraphProperties11 = new A.Level8ParagraphProperties()
            {
                LeftMargin = 3200400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties108 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill45   = new A.SolidFill();
            A.SchemeColor schemeColor55 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill45.Append(schemeColor55);
            A.LatinFont latinFont29 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont29 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont29 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties108.Append(solidFill45);
            defaultRunProperties108.Append(latinFont29);
            defaultRunProperties108.Append(eastAsianFont29);
            defaultRunProperties108.Append(complexScriptFont29);

            level8ParagraphProperties11.Append(defaultRunProperties108);

            A.Level9ParagraphProperties level9ParagraphProperties11 = new A.Level9ParagraphProperties()
            {
                LeftMargin = 3657600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 457200, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties109 = new A.DefaultRunProperties()
            {
                FontSize = 1800, Kerning = 1200
            };

            A.SolidFill   solidFill46   = new A.SolidFill();
            A.SchemeColor schemeColor56 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill46.Append(schemeColor56);
            A.LatinFont latinFont30 = new A.LatinFont()
            {
                Typeface = "+mn-lt"
            };
            A.EastAsianFont eastAsianFont30 = new A.EastAsianFont()
            {
                Typeface = "+mn-ea"
            };
            A.ComplexScriptFont complexScriptFont30 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties109.Append(solidFill46);
            defaultRunProperties109.Append(latinFont30);
            defaultRunProperties109.Append(eastAsianFont30);
            defaultRunProperties109.Append(complexScriptFont30);

            level9ParagraphProperties11.Append(defaultRunProperties109);

            defaultTextStyle1.Append(defaultParagraphProperties2);
            defaultTextStyle1.Append(level1ParagraphProperties19);
            defaultTextStyle1.Append(level2ParagraphProperties11);
            defaultTextStyle1.Append(level3ParagraphProperties11);
            defaultTextStyle1.Append(level4ParagraphProperties11);
            defaultTextStyle1.Append(level5ParagraphProperties11);
            defaultTextStyle1.Append(level6ParagraphProperties11);
            defaultTextStyle1.Append(level7ParagraphProperties11);
            defaultTextStyle1.Append(level8ParagraphProperties11);
            defaultTextStyle1.Append(level9ParagraphProperties11);

            PresentationExtensionList presentationExtensionList1 = new PresentationExtensionList();

            PresentationExtension presentationExtension1 = new PresentationExtension()
            {
                Uri = "{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"
            };

            P15.SlideGuideList slideGuideList1 = new P15.SlideGuideList();
            slideGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            presentationExtension1.Append(slideGuideList1);

            presentationExtensionList1.Append(presentationExtension1);

            presentation1.Append(slideMasterIdList1);
            presentation1.Append(slideIdList1);
            presentation1.Append(slideSize1);
            presentation1.Append(notesSize1);
            presentation1.Append(defaultTextStyle1);
            presentation1.Append(presentationExtensionList1);

            part.Presentation = presentation1;
        }
Esempio n. 11
0
        public SimpleAnimation getSimpleAnimationFromCommonTimeNodePreset(CommonTimeNode commonTimeNode, SlideSize SlideSizes)
        {
            SimpleAnimation result = new SimpleAnimation();

            if (AnimationTypes.TypePath.Equals(commonTimeNode.PresetClass))
            {
                return(new MotionPathAnimation(commonTimeNode, Slide.slideIndex, SlideSizes));
            }
            else if (AnimationTypes.TypeEntrance.Equals(commonTimeNode.PresetClass))
            {
                result.InitialState = 1;
            }
            else if (AnimationTypes.TypeExit.Equals(commonTimeNode.PresetClass))
            {
                result.InitialState = 2;
            }
            else if (AnimationTypes.TypeEmphasis.Equals(commonTimeNode.PresetClass))
            {
                result.InitialState = 3;
            }
            else
            {
                return(null);
            }
            if (commonTimeNode.PresetId == null)
            {
                return(null);
            }
            result.timingType = commonTimeNode.NodeType;

            //Get the speed from one of the nodes common behavior. Hopefully all nodes have the same speed (since the animation is the same).
            foreach (Object xmlEl in commonTimeNode.Descendants())
            {
                if (xmlEl.GetType().Equals(typeof(CommonBehavior)))
                {
                    CommonBehavior bhvr = ((CommonBehavior)xmlEl);

                    if (bhvr.CommonTimeNode != null)
                    {
                        result.FixAnimationTimings(bhvr, Slide.slideIndex);
                        if (result.Length <= 1)
                        {
                            continue;
                        }
                        if (result.Start == 0)
                        {
                            Condition condition = commonTimeNode.StartConditionList.FirstChild as Condition;
                            if (!condition.Delay.Equals("indefinite"))
                            {
                                result.Start = int.Parse(condition.Delay);
                            }
                        }
                        break;
                    }
                }
            }
            if (result.Length <= 1)
            {
                result.Length = 100;  //Default value??
            }
            if (AnimationTypes.TypeEmphasis.Equals(commonTimeNode.PresetClass))
            {
                result = handleEmphasisAnimation(commonTimeNode, result);
            }
            else
            {
                result = handleEntranceAnimation(commonTimeNode, result);
            }


            if (result.AdditionalData == null || result.AdditionalData == "0") //There are default values. Horizontal In = horizontal + in ;)
            {
                switch (commonTimeNode.PresetSubtype.Value)
                {
                case 0: result.AdditionalData = "0"; break;

                case 4: result.AdditionalData = "3"; break;      //From bottom

                case 2: result.AdditionalData = "2"; break;      //From right

                case 1: result.AdditionalData = "1"; break;      //From top

                case 8: result.AdditionalData = "4"; break;      //From left

                case 6: result.AdditionalData = "8"; break;      //Bottom right

                case 3: result.AdditionalData = "7"; break;      //Top right

                case 9: result.AdditionalData = "6"; break;      //Top right

                case 12: result.AdditionalData = "9"; break;     //Bottom left

                case 10: result.AdditionalData = "16"; break;    //Horizontal

                case 5: result.AdditionalData = "17"; break;     //Vertical

                case 26: result.AdditionalData = "23"; break;    //Horizontal in

                case 42: result.AdditionalData = "24"; break;    //Horizontal out

                case 21: result.AdditionalData = "25"; break;    //Vertical in

                case 37: result.AdditionalData = "26"; break;    //Vertical out

                case 16: result.AdditionalData = "19"; break;    //in

                case 32: result.AdditionalData = "20"; break;    //out
                }
            }

            checkIsText(result);
            return(result);
        }
Esempio n. 12
0
 public PPTSlide(SlidePart slidePart, int slideIndex, DefaultTextStyle defaultTextStyle, string fileName, SlideSize SlideSizes)
 {
     this.advanceAfterTime = -1;
     this.slideIndex       = slideIndex;
     this.fileName         = fileName;
     this.defaultTextStyle = defaultTextStyle;
     SlideLayoutPart       = slidePart.SlideLayoutPart;
     SetShapeNonVisualProperties(slidePart);
     SetSpecificProperties(slidePart);
     Id         = "s1s0";
     Transition = JSONGenerator.GenerateTransitionAnimationObject(slidePart.Slide.Transition);
     Animations = new List <IAnimation>();
     AddAnimations(slidePart.Slide.Timing, Animations, SlideSizes);
 }
Esempio n. 13
0
        public void AddAnimations(OpenXmlCompositeElement element, List <IAnimation> resultList, SlideSize SlideSizes)
        {
            if (element == null)
            {
                return;
            }

            List <AnimateMotion> motions = new List <AnimateMotion>();
            IAnimation           animationForThisNode = null;

            if (element.GetType().Equals(typeof(CommonTimeNode)))
            {
                CommonTimeNode node = (CommonTimeNode)element;
                animationForThisNode = new JSONGenerator(this).getSimpleAnimationFromCommonTimeNodePreset(node, SlideSizes);

                if (animationForThisNode != null)
                {
                    resultList.Add(animationForThisNode);
                    //Check if object id is presented in animation list.
                    CheckAndSetAnimatableProperty(animationForThisNode.ObjectId);

                    if ((animationForThisNode.InnerAnimations == null ||
                         animationForThisNode.InnerAnimations.Count == 0) &&
                        animationForThisNode.IsItEntranceAnimation())
                    {
                        MakeShapeInvisible("s1s" + animationForThisNode.ObjectId);
                    }
                    else if (animationForThisNode.InnerAnimations != null)
                    {
                        foreach (IAnimation anAnimation in animationForThisNode.InnerAnimations)
                        {
                            if (anAnimation.IsItEntranceAnimation())
                            {
                                MakeShapeInvisible("s1s" + animationForThisNode.ObjectId);
                            }
                        }
                    }
                    return;
                }
                else
                {
                    /*
                     * Sometimes there are common time nodes without animations in them. They are used for grouping animations.
                     * Usually animations are grouped for timing purposes like adding delay to all, or start a group after another.
                     * It's a tree structure and here we try to follow it as much as possible. Later we will strip the unnecessary nodes
                     */

                    animationForThisNode = new SimpleAnimation();
                    if (node.NodeType != null)
                    {
                        ((SimpleAnimation)animationForThisNode).timingType = node.NodeType;
                    }
                    int delay = 0;
                    if (node.StartConditionList != null)
                    {
                        foreach (Condition cond in node.StartConditionList)
                        {
                            if (cond.Delay != null && "indefinite" != cond.Delay.Value && cond.Delay.HasValue)
                            {
                                delay = delay + int.Parse(cond.Delay.Value);
                            }
                        }
                    }
                    if (delay > 0)
                    {
                        animationForThisNode.Start = delay;
                    }
                }

                if (animationForThisNode != null)
                {
                    animationForThisNode.InnerAnimations = new List <IAnimation>();
                    resultList.Add(animationForThisNode);
                }
            }

            //Go recursive in the Open XML tree

            foreach (OpenXmlElement obj in element.ChildElements)
            {
                if (obj.GetType().IsSubclassOf(typeof(OpenXmlCompositeElement)))
                {
                    if (animationForThisNode == null)
                    {
                        AddAnimations((OpenXmlCompositeElement)obj, resultList, SlideSizes);
                    }
                    else
                    {
                        AddAnimations((OpenXmlCompositeElement)obj, animationForThisNode.InnerAnimations, SlideSizes);
                    }
                }
            }
        }
        public static void GeneratePresentationPart1Content(PresentationPart presentationPart1)
        {
            Presentation presentation1 = new Presentation()
            {
                ShowSpecialPlaceholderOnTitleSlide = false, RemovePersonalInfoOnSave = true, StrictFirstAndLastChars = false, SaveSubsetFonts = true
            };

            presentation1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");
            presentation1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            presentation1.AddNamespaceDeclaration("p", "http://schemas.openxmlformats.org/presentationml/2006/main");

            SlideMasterIdList slideMasterIdList1 = new SlideMasterIdList();
            SlideMasterId     slideMasterId1     = new SlideMasterId()
            {
                Id = (UInt32Value)2147483648U, RelationshipId = "rId4"
            };

            slideMasterIdList1.Append(slideMasterId1);

            NotesMasterIdList notesMasterIdList1 = new NotesMasterIdList();
            NotesMasterId     notesMasterId1     = new NotesMasterId()
            {
                Id = "rId6"
            };

            notesMasterIdList1.Append(notesMasterId1);

            HandoutMasterIdList handoutMasterIdList1 = new HandoutMasterIdList();
            HandoutMasterId     handoutMasterId1     = new HandoutMasterId()
            {
                Id = "rId7"
            };

            handoutMasterIdList1.Append(handoutMasterId1);

            SlideIdList slideIdList1 = new SlideIdList();
            SlideId     slideId1     = new SlideId()
            {
                Id = (UInt32Value)371U, RelationshipId = "rId5"
            };

            slideIdList1.Append(slideId1);
            SlideSize slideSize1 = new SlideSize()
            {
                Cx = 9906000, Cy = 6858000, Type = SlideSizeValues.A4
            };
            NotesSize notesSize1 = new NotesSize()
            {
                Cx = 6797675L, Cy = 9874250L
            };

            DefaultTextStyle defaultTextStyle1 = new DefaultTextStyle();

            A.DefaultParagraphProperties defaultParagraphProperties1 = new A.DefaultParagraphProperties();
            A.DefaultRunProperties       defaultRunProperties1       = new A.DefaultRunProperties()
            {
                Language = "en-US"
            };

            defaultParagraphProperties1.Append(defaultRunProperties1);

            A.Level1ParagraphProperties level1ParagraphProperties1 = new A.Level1ParagraphProperties()
            {
                Alignment = A.TextAlignmentTypeValues.Left, RightToLeft = false, EastAsianLineBreak = false, FontAlignment = A.TextFontAlignmentValues.Baseline, Height = false
            };

            A.SpaceBefore    spaceBefore1    = new A.SpaceBefore();
            A.SpacingPercent spacingPercent1 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceBefore1.Append(spacingPercent1);

            A.SpaceAfter     spaceAfter1     = new A.SpaceAfter();
            A.SpacingPercent spacingPercent2 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceAfter1.Append(spacingPercent2);

            A.DefaultRunProperties defaultRunProperties2 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill1   = new A.SolidFill();
            A.SchemeColor schemeColor1 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill1.Append(schemeColor1);
            A.LatinFont latinFont1 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont1 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont1 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties2.Append(solidFill1);
            defaultRunProperties2.Append(latinFont1);
            defaultRunProperties2.Append(eastAsianFont1);
            defaultRunProperties2.Append(complexScriptFont1);

            level1ParagraphProperties1.Append(spaceBefore1);
            level1ParagraphProperties1.Append(spaceAfter1);
            level1ParagraphProperties1.Append(defaultRunProperties2);

            A.Level2ParagraphProperties level2ParagraphProperties1 = new A.Level2ParagraphProperties()
            {
                LeftMargin = 457200, Alignment = A.TextAlignmentTypeValues.Left, RightToLeft = false, EastAsianLineBreak = false, FontAlignment = A.TextFontAlignmentValues.Baseline, Height = false
            };

            A.SpaceBefore    spaceBefore2    = new A.SpaceBefore();
            A.SpacingPercent spacingPercent3 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceBefore2.Append(spacingPercent3);

            A.SpaceAfter     spaceAfter2     = new A.SpaceAfter();
            A.SpacingPercent spacingPercent4 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceAfter2.Append(spacingPercent4);

            A.DefaultRunProperties defaultRunProperties3 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill2   = new A.SolidFill();
            A.SchemeColor schemeColor2 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill2.Append(schemeColor2);
            A.LatinFont latinFont2 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont2 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont2 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties3.Append(solidFill2);
            defaultRunProperties3.Append(latinFont2);
            defaultRunProperties3.Append(eastAsianFont2);
            defaultRunProperties3.Append(complexScriptFont2);

            level2ParagraphProperties1.Append(spaceBefore2);
            level2ParagraphProperties1.Append(spaceAfter2);
            level2ParagraphProperties1.Append(defaultRunProperties3);

            A.Level3ParagraphProperties level3ParagraphProperties1 = new A.Level3ParagraphProperties()
            {
                LeftMargin = 914400, Alignment = A.TextAlignmentTypeValues.Left, RightToLeft = false, EastAsianLineBreak = false, FontAlignment = A.TextFontAlignmentValues.Baseline, Height = false
            };

            A.SpaceBefore    spaceBefore3    = new A.SpaceBefore();
            A.SpacingPercent spacingPercent5 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceBefore3.Append(spacingPercent5);

            A.SpaceAfter     spaceAfter3     = new A.SpaceAfter();
            A.SpacingPercent spacingPercent6 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceAfter3.Append(spacingPercent6);

            A.DefaultRunProperties defaultRunProperties4 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill3   = new A.SolidFill();
            A.SchemeColor schemeColor3 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill3.Append(schemeColor3);
            A.LatinFont latinFont3 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont3 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont3 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties4.Append(solidFill3);
            defaultRunProperties4.Append(latinFont3);
            defaultRunProperties4.Append(eastAsianFont3);
            defaultRunProperties4.Append(complexScriptFont3);

            level3ParagraphProperties1.Append(spaceBefore3);
            level3ParagraphProperties1.Append(spaceAfter3);
            level3ParagraphProperties1.Append(defaultRunProperties4);

            A.Level4ParagraphProperties level4ParagraphProperties1 = new A.Level4ParagraphProperties()
            {
                LeftMargin = 1371600, Alignment = A.TextAlignmentTypeValues.Left, RightToLeft = false, EastAsianLineBreak = false, FontAlignment = A.TextFontAlignmentValues.Baseline, Height = false
            };

            A.SpaceBefore    spaceBefore4    = new A.SpaceBefore();
            A.SpacingPercent spacingPercent7 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceBefore4.Append(spacingPercent7);

            A.SpaceAfter     spaceAfter4     = new A.SpaceAfter();
            A.SpacingPercent spacingPercent8 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceAfter4.Append(spacingPercent8);

            A.DefaultRunProperties defaultRunProperties5 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill4   = new A.SolidFill();
            A.SchemeColor schemeColor4 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill4.Append(schemeColor4);
            A.LatinFont latinFont4 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont4 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont4 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties5.Append(solidFill4);
            defaultRunProperties5.Append(latinFont4);
            defaultRunProperties5.Append(eastAsianFont4);
            defaultRunProperties5.Append(complexScriptFont4);

            level4ParagraphProperties1.Append(spaceBefore4);
            level4ParagraphProperties1.Append(spaceAfter4);
            level4ParagraphProperties1.Append(defaultRunProperties5);

            A.Level5ParagraphProperties level5ParagraphProperties1 = new A.Level5ParagraphProperties()
            {
                LeftMargin = 1828800, Alignment = A.TextAlignmentTypeValues.Left, RightToLeft = false, EastAsianLineBreak = false, FontAlignment = A.TextFontAlignmentValues.Baseline, Height = false
            };

            A.SpaceBefore    spaceBefore5    = new A.SpaceBefore();
            A.SpacingPercent spacingPercent9 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceBefore5.Append(spacingPercent9);

            A.SpaceAfter     spaceAfter5      = new A.SpaceAfter();
            A.SpacingPercent spacingPercent10 = new A.SpacingPercent()
            {
                Val = 0
            };

            spaceAfter5.Append(spacingPercent10);

            A.DefaultRunProperties defaultRunProperties6 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill5   = new A.SolidFill();
            A.SchemeColor schemeColor5 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill5.Append(schemeColor5);
            A.LatinFont latinFont5 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont5 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont5 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties6.Append(solidFill5);
            defaultRunProperties6.Append(latinFont5);
            defaultRunProperties6.Append(eastAsianFont5);
            defaultRunProperties6.Append(complexScriptFont5);

            level5ParagraphProperties1.Append(spaceBefore5);
            level5ParagraphProperties1.Append(spaceAfter5);
            level5ParagraphProperties1.Append(defaultRunProperties6);

            A.Level6ParagraphProperties level6ParagraphProperties1 = new A.Level6ParagraphProperties()
            {
                LeftMargin = 2286000, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties7 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill6   = new A.SolidFill();
            A.SchemeColor schemeColor6 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill6.Append(schemeColor6);
            A.LatinFont latinFont6 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont6 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont6 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties7.Append(solidFill6);
            defaultRunProperties7.Append(latinFont6);
            defaultRunProperties7.Append(eastAsianFont6);
            defaultRunProperties7.Append(complexScriptFont6);

            level6ParagraphProperties1.Append(defaultRunProperties7);

            A.Level7ParagraphProperties level7ParagraphProperties1 = new A.Level7ParagraphProperties()
            {
                LeftMargin = 2743200, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties8 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill7   = new A.SolidFill();
            A.SchemeColor schemeColor7 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill7.Append(schemeColor7);
            A.LatinFont latinFont7 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont7 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont7 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties8.Append(solidFill7);
            defaultRunProperties8.Append(latinFont7);
            defaultRunProperties8.Append(eastAsianFont7);
            defaultRunProperties8.Append(complexScriptFont7);

            level7ParagraphProperties1.Append(defaultRunProperties8);

            A.Level8ParagraphProperties level8ParagraphProperties1 = new A.Level8ParagraphProperties()
            {
                LeftMargin = 3200400, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties9 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill8   = new A.SolidFill();
            A.SchemeColor schemeColor8 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill8.Append(schemeColor8);
            A.LatinFont latinFont8 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont8 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont8 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties9.Append(solidFill8);
            defaultRunProperties9.Append(latinFont8);
            defaultRunProperties9.Append(eastAsianFont8);
            defaultRunProperties9.Append(complexScriptFont8);

            level8ParagraphProperties1.Append(defaultRunProperties9);

            A.Level9ParagraphProperties level9ParagraphProperties1 = new A.Level9ParagraphProperties()
            {
                LeftMargin = 3657600, Alignment = A.TextAlignmentTypeValues.Left, DefaultTabSize = 914400, RightToLeft = false, EastAsianLineBreak = true, LatinLineBreak = false, Height = true
            };

            A.DefaultRunProperties defaultRunProperties10 = new A.DefaultRunProperties()
            {
                FontSize = 2400, Kerning = 1200
            };

            A.SolidFill   solidFill9   = new A.SolidFill();
            A.SchemeColor schemeColor9 = new A.SchemeColor()
            {
                Val = A.SchemeColorValues.Text1
            };

            solidFill9.Append(schemeColor9);
            A.LatinFont latinFont9 = new A.LatinFont()
            {
                Typeface = "Arial", Panose = "020B0604020202020204", PitchFamily = 34, CharacterSet = 0
            };
            A.EastAsianFont eastAsianFont9 = new A.EastAsianFont()
            {
                Typeface = "MS PGothic", Panose = "020B0600070205080204", PitchFamily = 34, CharacterSet = -128
            };
            A.ComplexScriptFont complexScriptFont9 = new A.ComplexScriptFont()
            {
                Typeface = "+mn-cs"
            };

            defaultRunProperties10.Append(solidFill9);
            defaultRunProperties10.Append(latinFont9);
            defaultRunProperties10.Append(eastAsianFont9);
            defaultRunProperties10.Append(complexScriptFont9);

            level9ParagraphProperties1.Append(defaultRunProperties10);

            defaultTextStyle1.Append(defaultParagraphProperties1);
            defaultTextStyle1.Append(level1ParagraphProperties1);
            defaultTextStyle1.Append(level2ParagraphProperties1);
            defaultTextStyle1.Append(level3ParagraphProperties1);
            defaultTextStyle1.Append(level4ParagraphProperties1);
            defaultTextStyle1.Append(level5ParagraphProperties1);
            defaultTextStyle1.Append(level6ParagraphProperties1);
            defaultTextStyle1.Append(level7ParagraphProperties1);
            defaultTextStyle1.Append(level8ParagraphProperties1);
            defaultTextStyle1.Append(level9ParagraphProperties1);

            PresentationExtensionList presentationExtensionList1 = new PresentationExtensionList();

            PresentationExtension presentationExtension1 = new PresentationExtension()
            {
                Uri = "{EFAFB233-063F-42B5-8137-9DF3F51BA10A}"
            };

            P15.SlideGuideList slideGuideList1 = new P15.SlideGuideList();
            slideGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            P15.ExtendedGuide extendedGuide1 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)1U, Orientation = DirectionValues.Horizontal, Position = 240
            };

            P15.ColorType      colorType1        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex1 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType1.Append(rgbColorModelHex1);

            extendedGuide1.Append(colorType1);

            P15.ExtendedGuide extendedGuide2 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)2U, Orientation = DirectionValues.Horizontal, Position = 3648, IsUserDrawn = true
            };

            P15.ColorType      colorType2        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex2 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType2.Append(rgbColorModelHex2);

            extendedGuide2.Append(colorType2);

            P15.ExtendedGuide extendedGuide3 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)4U, Position = 2736, IsUserDrawn = true
            };

            P15.ColorType      colorType3        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex3 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType3.Append(rgbColorModelHex3);

            extendedGuide3.Append(colorType3);

            P15.ExtendedGuide extendedGuide4 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)5U, Position = 5904
            };

            P15.ColorType      colorType4        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex4 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType4.Append(rgbColorModelHex4);

            extendedGuide4.Append(colorType4);

            P15.ExtendedGuide extendedGuide5 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)6U, Position = 336
            };

            P15.ColorType      colorType5        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex5 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType5.Append(rgbColorModelHex5);

            extendedGuide5.Append(colorType5);

            P15.ExtendedGuide extendedGuide6 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)7U, Orientation = DirectionValues.Horizontal, IsUserDrawn = true
            };

            P15.ColorType      colorType6        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex6 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType6.Append(rgbColorModelHex6);

            extendedGuide6.Append(colorType6);

            P15.ExtendedGuide extendedGuide7 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)8U, Orientation = DirectionValues.Horizontal, Position = 1152, IsUserDrawn = true
            };

            P15.ColorType      colorType7        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex7 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType7.Append(rgbColorModelHex7);

            extendedGuide7.Append(colorType7);

            P15.ExtendedGuide extendedGuide8 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)9U, Orientation = DirectionValues.Horizontal, Position = 1200, IsUserDrawn = true
            };

            P15.ColorType      colorType8        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex8 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType8.Append(rgbColorModelHex8);

            extendedGuide8.Append(colorType8);

            P15.ExtendedGuide extendedGuide9 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)10U, Position = 2784, IsUserDrawn = true
            };

            P15.ColorType      colorType9        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex9 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType9.Append(rgbColorModelHex9);

            extendedGuide9.Append(colorType9);

            P15.ExtendedGuide extendedGuide10 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)12U, Orientation = DirectionValues.Horizontal, Position = 2448, IsUserDrawn = true
            };

            P15.ColorType      colorType10        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex10 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType10.Append(rgbColorModelHex10);

            extendedGuide10.Append(colorType10);

            P15.ExtendedGuide extendedGuide11 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)13U, Orientation = DirectionValues.Horizontal, Position = 2496, IsUserDrawn = true
            };

            P15.ColorType      colorType11        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex11 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType11.Append(rgbColorModelHex11);

            extendedGuide11.Append(colorType11);

            P15.ExtendedGuide extendedGuide12 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)14U, Position = 1872, IsUserDrawn = true
            };

            P15.ColorType      colorType12        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex12 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType12.Append(rgbColorModelHex12);

            extendedGuide12.Append(colorType12);

            P15.ExtendedGuide extendedGuide13 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)15U, Position = 2688, IsUserDrawn = true
            };

            P15.ColorType      colorType13        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex13 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType13.Append(rgbColorModelHex13);

            extendedGuide13.Append(colorType13);

            P15.ExtendedGuide extendedGuide14 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)16U, Orientation = DirectionValues.Horizontal, Position = 288, IsUserDrawn = true
            };

            P15.ColorType      colorType14        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex14 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType14.Append(rgbColorModelHex14);

            extendedGuide14.Append(colorType14);

            P15.ExtendedGuide extendedGuide15 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)17U, Orientation = DirectionValues.Horizontal, Position = 1104, IsUserDrawn = true
            };

            P15.ColorType      colorType15        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex15 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType15.Append(rgbColorModelHex15);

            extendedGuide15.Append(colorType15);

            slideGuideList1.Append(extendedGuide1);
            slideGuideList1.Append(extendedGuide2);
            slideGuideList1.Append(extendedGuide3);
            slideGuideList1.Append(extendedGuide4);
            slideGuideList1.Append(extendedGuide5);
            slideGuideList1.Append(extendedGuide6);
            slideGuideList1.Append(extendedGuide7);
            slideGuideList1.Append(extendedGuide8);
            slideGuideList1.Append(extendedGuide9);
            slideGuideList1.Append(extendedGuide10);
            slideGuideList1.Append(extendedGuide11);
            slideGuideList1.Append(extendedGuide12);
            slideGuideList1.Append(extendedGuide13);
            slideGuideList1.Append(extendedGuide14);
            slideGuideList1.Append(extendedGuide15);

            presentationExtension1.Append(slideGuideList1);

            PresentationExtension presentationExtension2 = new PresentationExtension()
            {
                Uri = "{2D200454-40CA-4A62-9FC3-DE9A4176ACB9}"
            };

            P15.NotesGuideList notesGuideList1 = new P15.NotesGuideList();
            notesGuideList1.AddNamespaceDeclaration("p15", "http://schemas.microsoft.com/office/powerpoint/2012/main");

            P15.ExtendedGuide extendedGuide16 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)1U, Orientation = DirectionValues.Horizontal, Position = 3110, IsUserDrawn = true
            };

            P15.ColorType      colorType16        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex16 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType16.Append(rgbColorModelHex16);

            extendedGuide16.Append(colorType16);

            P15.ExtendedGuide extendedGuide17 = new P15.ExtendedGuide()
            {
                Id = (UInt32Value)2U, Position = 2140, IsUserDrawn = true
            };

            P15.ColorType      colorType17        = new P15.ColorType();
            A.RgbColorModelHex rgbColorModelHex17 = new A.RgbColorModelHex()
            {
                Val = "A4A3A4"
            };

            colorType17.Append(rgbColorModelHex17);

            extendedGuide17.Append(colorType17);

            notesGuideList1.Append(extendedGuide16);
            notesGuideList1.Append(extendedGuide17);

            presentationExtension2.Append(notesGuideList1);

            presentationExtensionList1.Append(presentationExtension1);
            presentationExtensionList1.Append(presentationExtension2);

            presentation1.Append(slideMasterIdList1);
            presentation1.Append(notesMasterIdList1);
            presentation1.Append(handoutMasterIdList1);
            presentation1.Append(slideIdList1);
            presentation1.Append(slideSize1);
            presentation1.Append(notesSize1);
            presentation1.Append(defaultTextStyle1);
            presentation1.Append(presentationExtensionList1);

            presentationPart1.Presentation = presentation1;
        }
Esempio n. 15
0
        public MotionPathAnimation(CommonTimeNode commonTimeNode, int slideIndex, SlideSize SlideSizes)
        {
            this.SlideSizes = SlideSizes;
            InitialState    = 4;
            timingType      = commonTimeNode.NodeType;
            Type            = AnimationTypes.MotionPath;
            AnimateMotion motion = null;

            foreach (Object xmlEl in commonTimeNode.Descendants())
            {
                if (xmlEl.GetType().Equals(typeof(AnimateMotion)))
                {
                    motion = (AnimateMotion)xmlEl;
                }
            }
            if (motion == null)
            {
                return;
            }
            String path = motion.Path.Value;

            String[] parts = path.Split();
            motionPath = new List <PathPart>();
            int  indexPart = -1;
            bool isX       = true;

            foreach (string part in parts)
            {
                if ("".Equals(part) || "E".Equals(part))  //We add our End tag
                {
                    continue;
                }
                Double coords = 0.0;
                if (!Double.TryParse(part, NumberStyles.Float, CultureInfo.InvariantCulture, out coords))
                {
                    isX = true;
                    if (indexPart >= 0)
                    {  //FIX FOR POINTS WITH 3 COORDINATES UNTIL WE KNOW WHAT THEY ARE.
                        List <PathPoint> previousPartPoints = motionPath[indexPart].points;
                        if (previousPartPoints[previousPartPoints.Count - 1].Y.CompareTo(0) == 0)
                        {
                            previousPartPoints.Remove(previousPartPoints[previousPartPoints.Count - 1]);
                        }
                    }

                    indexPart++;
                    motionPath.Add(new PathPart());
                    motionPath[indexPart].typeCharacter = part;
                }
                else if (isX)
                {
                    coords = coords * MultiplierX();
                    PathPoint newPoint = new PathPoint();
                    newPoint.X = coords;
                    motionPath[indexPart].points.Add(newPoint);   // We have a new point
                    isX = !isX;
                }
                else
                {
                    coords = coords * MultiplierY();
                    motionPath[indexPart].points[motionPath[indexPart].points.Count - 1].Y = coords;  //Set Y for the last point
                    isX = !isX;
                }
            }


            FixAnimationTimings(motion.CommonBehavior, slideIndex);
            generateAdditionDataString(motionPath);
        }
Esempio n. 16
0
        public static void LoadAvailableFormats()
        {
            if (!ResourceManager.Instance.SlideSizeSettingsFile.ExistsLocal())
            {
                return;
            }
            var document = new XmlDocument();

            document.Load(ResourceManager.Instance.SlideSizeSettingsFile.LocalPath);
            foreach (var formatNode in document.SelectNodes(@"/Settings/Format").OfType <XmlNode>())
            {
                var slideFormat           = new SlideFormat();
                var slideFormatAttributes = formatNode.Attributes.OfType <XmlAttribute>().ToList();
                var idAttribute           = slideFormatAttributes.FirstOrDefault(a => a.Name == "Name");
                if (idAttribute == null)
                {
                    continue;
                }

                SlideFormatEnum slideFormatId;
                if (!Enum.TryParse(String.Format("Format{0}", idAttribute.Value), out slideFormatId))
                {
                    continue;
                }
                slideFormat.Id = slideFormatId;

                foreach (var sizeNode in formatNode.ChildNodes.OfType <XmlNode>())
                {
                    var slideSize           = new SlideSize();
                    var slideSizeAttributes = sizeNode.Attributes.OfType <XmlAttribute>().ToList();

                    decimal temp;

                    var widthAttribute = slideSizeAttributes.FirstOrDefault(a => a.Name == "Width");
                    if (widthAttribute == null)
                    {
                        continue;
                    }
                    if (!Decimal.TryParse(widthAttribute.Value, out temp))
                    {
                        continue;
                    }
                    slideSize.Width = temp;

                    var heightAttribute = slideSizeAttributes.FirstOrDefault(a => a.Name == "Height");
                    if (heightAttribute == null)
                    {
                        continue;
                    }
                    if (!Decimal.TryParse(heightAttribute.Value, out temp))
                    {
                        continue;
                    }
                    slideSize.Height = temp;

                    slideFormat.SupportedSizes.Add(slideSize);

                    var  defaultAttribute = slideSizeAttributes.FirstOrDefault(a => a.Name == "IsDefault");
                    bool isDefault;
                    if (defaultAttribute != null && Boolean.TryParse(defaultAttribute.Value, out isDefault) && isDefault)
                    {
                        slideFormat.DefaultSize = slideSize;
                    }
                }

                if (slideFormat.DefaultSize == null)
                {
                    slideFormat.DefaultSize = slideFormat.SupportedSizes.FirstOrDefault();
                }

                _availableFormats.Add(slideFormat);
            }
        }