Beispiel #1
0
        public override ShapeEx Create(OpenXmlElement sdkElement)
        {
            Check.NotNull(sdkElement, nameof(sdkElement));

            if (sdkElement is P.GraphicFrame sdkGraphicFrame)
            {
                var grData = sdkElement.GetFirstChild <A.Graphic>().GetFirstChild <A.GraphicData>();
                if (grData.Uri.Value.Equals(Uri, StringComparison.Ordinal))
                {
                    var spContext      = _shapeContextBuilder.Build(sdkElement);
                    var innerTransform = _transformFactory.FromComposite(sdkGraphicFrame);
                    var ole            = new OleObject(sdkGraphicFrame);
                    var shape          = _shapeBuilder.WithOle(innerTransform, spContext, ole);

                    return(shape);
                }
            }

            if (Successor != null)
            {
                return(Successor.Create(sdkElement));
            }

            return(null);
        }
Beispiel #2
0
        public override ShapeEx Create(OpenXmlElement openXmlElement)
        {
            Check.NotNull(openXmlElement, nameof(openXmlElement));

            if (openXmlElement is P.GraphicFrame sdkGraphicFrame)
            {
                var grData = openXmlElement.GetFirstChild <A.Graphic>().GetFirstChild <A.GraphicData>();
                if (grData.Uri.Value.Equals(Uri))
                {
                    var spContext      = new ShapeContext(_preSettings, _sldFontService, openXmlElement, _sdkSldPart);
                    var innerTransform = _transformFactory.FromComposite(sdkGraphicFrame);
                    var ole            = new OleObject(sdkGraphicFrame);
                    var shape          = _shapeBuilder.WithOle(innerTransform, spContext, ole);

                    return(shape);
                }
            }

            if (Successor != null)
            {
                return(Successor.Create(openXmlElement));
            }

            return(null);
        }