Beispiel #1
0
 internal LayoutPicture(SCSlideLayout slideLayout, P.Picture pPicture)
     : base(slideLayout, pPicture)
 {
 }
 internal SCSlideMaster GetSlideMasterByLayout(SCSlideLayout slideLayout)
 {
     return(CollectionItems.First(sldMaster =>
                                  sldMaster.SlideLayouts.Any(sl => sl.SlideLayoutPart == slideLayout.SlideLayoutPart)));
 }
Beispiel #3
0
 public LayoutChart(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame) : base(slideLayout, pGraphicFrame)
 {
 }
Beispiel #4
0
 internal LayoutOLEObject(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame)
     : base(slideLayout, pGraphicFrame)
 {
 }
        internal static ShapeCollection CreateForSlideLayout(P.ShapeTree pShapeTree, SCSlideLayout slideLayout)
        {
            var shapeList = new List <IShape>();

            foreach (OpenXmlCompositeElement compositeElement in pShapeTree.OfType <OpenXmlCompositeElement>())
            {
                switch (compositeElement)
                {
                case P.Shape pShape:
                    shapeList.Add(new LayoutAutoShape(slideLayout, pShape));
                    continue;

                case P.GraphicFrame pGraphicFrame:
                {
                    A.GraphicData aGraphicData =
                        pGraphicFrame.GetFirstChild <A.Graphic>().GetFirstChild <A.GraphicData>();
                    if (aGraphicData.Uri.Value.Equals("http://schemas.openxmlformats.org/presentationml/2006/ole",
                                                      StringComparison.Ordinal))
                    {
                        shapeList.Add(new LayoutOLEObject(slideLayout, pGraphicFrame));
                        continue;
                    }

                    if (aGraphicData.Uri.Value.Equals("http://schemas.openxmlformats.org/drawingml/2006/chart",
                                                      StringComparison.Ordinal))
                    {
                        shapeList.Add(new LayoutChart(slideLayout, pGraphicFrame));
                        continue;
                    }

                    if (aGraphicData.Uri.Value.Equals("http://schemas.openxmlformats.org/drawingml/2006/table",
                                                      StringComparison.Ordinal))
                    {
                        shapeList.Add(new LayoutTable(slideLayout, pGraphicFrame));
                        continue;
                    }

                    break;
                }
                }

                // OLE Objects should be parsed before pictures, since OLE containers can contain p:pic elements,
                // thus OLE objects can be parsed as a picture by mistake.
                P.Picture pPicture;
                if (compositeElement is P.Picture treePicture)
                {
                    pPicture = treePicture;
                }
                else
                {
                    P.Picture framePicture = compositeElement.Descendants <P.Picture>().FirstOrDefault();
                    pPicture = framePicture;
                }

                if (pPicture != null)
                {
                    shapeList.Add(new LayoutPicture(slideLayout, pPicture));
                }
            }

            return(new ShapeCollection(shapeList));
        }
Beispiel #6
0
 protected LayoutShape(SCSlideLayout slideLayout, OpenXmlCompositeElement pShapeTreeChild) : base(
         pShapeTreeChild)
 {
     SlideLayout = slideLayout;
 }
Beispiel #7
0
 internal LayoutTable(SCSlideLayout slideLayout, P.GraphicFrame pGraphicFrame)
     : base(slideLayout, pGraphicFrame)
 {
 }