Exemple #1
0
        public static CT_PresetTextShape Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_PresetTextShape ctObj = new CT_PresetTextShape();

            if (node.Attribute("prst") != null)
            {
                ctObj.prst = (ST_TextShapeType)Enum.Parse(typeof(ST_TextShapeType), node.Attribute("prst").Value);
            }
            ctObj.avLst = new List <CT_GeomGuide>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "avLst")
                {
                    ctObj.avLst.Add(CT_GeomGuide.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemple #2
0
        public static CT_TextBodyProperties Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextBodyProperties ctObj = new CT_TextBodyProperties();

            ctObj.rot = XmlHelper.ReadInt(node.Attribute("rot"));
            ctObj.spcFirstLastPara = XmlHelper.ReadBool(node.Attribute("spcFirstLastPara"));
            if (node.Attribute("vertOverflow") != null)
            {
                ctObj.vertOverflow = (ST_TextVertOverflowType)Enum.Parse(typeof(ST_TextVertOverflowType), node.Attribute("vertOverflow").Value);
            }
            if (node.Attribute("horzOverflow") != null)
            {
                ctObj.horzOverflow = (ST_TextHorzOverflowType)Enum.Parse(typeof(ST_TextHorzOverflowType), node.Attribute("horzOverflow").Value);
            }
            if (node.Attribute("vert") != null)
            {
                ctObj.vert = (ST_TextVerticalType)Enum.Parse(typeof(ST_TextVerticalType), node.Attribute("vert").Value);
            }
            if (node.Attribute("wrap") != null)
            {
                ctObj.wrap = (ST_TextWrappingType)Enum.Parse(typeof(ST_TextWrappingType), node.Attribute("wrap").Value);
            }
            ctObj.lIns        = XmlHelper.ReadInt(node.Attribute("lIns"));
            ctObj.tIns        = XmlHelper.ReadInt(node.Attribute("tIns"));
            ctObj.rIns        = XmlHelper.ReadInt(node.Attribute("rIns"));
            ctObj.bIns        = XmlHelper.ReadInt(node.Attribute("bIns"));
            ctObj.numCol      = XmlHelper.ReadInt(node.Attribute("numCol"));
            ctObj.spcCol      = XmlHelper.ReadInt(node.Attribute("spcCol"));
            ctObj.rtlCol      = XmlHelper.ReadBool(node.Attribute("rtlCol"));
            ctObj.fromWordArt = XmlHelper.ReadBool(node.Attribute("fromWordArt"));
            if (node.Attribute("anchor") != null)
            {
                ctObj.anchor = (ST_TextAnchoringType)Enum.Parse(typeof(ST_TextAnchoringType), node.Attribute("anchor").Value);
            }
            ctObj.anchorCtr   = XmlHelper.ReadBool(node.Attribute("anchorCtr"));
            ctObj.forceAA     = XmlHelper.ReadBool(node.Attribute("forceAA"));
            ctObj.upright     = XmlHelper.ReadBool(node.Attribute("upright"));
            ctObj.compatLnSpc = XmlHelper.ReadBool(node.Attribute("compatLnSpc"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "prstTxWarp")
                {
                    ctObj.prstTxWarp = CT_PresetTextShape.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "noAutofit")
                {
                    ctObj.noAutofit = new CT_TextNoAutofit();
                }
                else if (childNode.Name.LocalName == "normAutofit")
                {
                    ctObj.normAutofit = CT_TextNormalAutofit.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "spAutoFit")
                {
                    ctObj.spAutoFit = new CT_TextShapeAutofit();
                }
                else if (childNode.Name.LocalName == "scene3d")
                {
                    ctObj.scene3d = CT_Scene3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sp3d")
                {
                    ctObj.sp3d = CT_Shape3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "flatTx")
                {
                    ctObj.flatTx = CT_FlatText.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }