コード例 #1
0
ファイル: OXmlAnchorDrawing.cs プロジェクト: 24/source_04
        //public void SetWrapThrough(EnumValue<DW.WrapTextValues> wrapText, DW.WrapPolygon wrapPolygon, uint distanceFromLeft = 0, uint distanceFromRight = 0)
        private OpenXmlElement CreateWrapThrough(OXmlAnchorWrapTight wrap)
        {
            // Through Wrapping, <wp:wrapThrough>
            DW.WrapThrough wrapElement = new DW.WrapThrough();

            // Text Wrapping Location, <wp:wrapTight wrapText>
            // BothSides - Both Sides ("bothSides"), Left - Left Side Only ("left"), Right - Right Side Only ("right"), Largest - Largest Side Only ("largest")
            wrapElement.WrapText = wrap.WrapText;

            // Tight Wrapping Extents Polygon, <wp:wrapPolygon>
            //wrapElement.WrapPolygon = wrapPolygon;

            if (wrap.DistanceFromLeft != null)
            {
                // Distance From Text on Left Edge, <wp:wrapTight distL>
                wrapElement.DistanceFromLeft = (uint)wrap.DistanceFromLeft;
            }
            if (wrap.DistanceFromRight != null)
            {
                // Distance From Text on Right Edge, <wp:wrapTight distR>
                wrapElement.DistanceFromRight = (uint)wrap.DistanceFromRight;
            }

            //_wrapElement = wrapElement;
            return(wrapElement);
        }
コード例 #2
0
ファイル: AnchorDrawing.cs プロジェクト: labeuze/source
        //public void SetWrapThrough(EnumValue<DW.WrapTextValues> wrapText, DW.WrapPolygon wrapPolygon, uint distanceFromLeft = 0, uint distanceFromRight = 0)
        private OpenXmlElement CreateWrapThrough(OXmlAnchorWrapTight wrap)
        {
            // Through Wrapping, <wp:wrapThrough>
            DW.WrapThrough wrapElement = new DW.WrapThrough();

            // Text Wrapping Location, <wp:wrapTight wrapText>
            // BothSides - Both Sides ("bothSides"), Left - Left Side Only ("left"), Right - Right Side Only ("right"), Largest - Largest Side Only ("largest")
            wrapElement.WrapText = wrap.WrapText;

            // Tight Wrapping Extents Polygon, <wp:wrapPolygon>
            //wrapElement.WrapPolygon = wrapPolygon;

            if (wrap.DistanceFromLeft != 0)
                // Distance From Text on Left Edge, <wp:wrapTight distL>
                wrapElement.DistanceFromLeft = wrap.DistanceFromLeft;
            if (wrap.DistanceFromRight != 0)
                // Distance From Text on Right Edge, <wp:wrapTight distR>
                wrapElement.DistanceFromRight = wrap.DistanceFromRight;

            //_wrapElement = wrapElement;
            return wrapElement;
        }