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

            ctObj.p = new List <CT_TextParagraph>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "bodyPr")
                {
                    ctObj.bodyPr = CT_TextBodyProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lstStyle")
                {
                    ctObj.lstStyle = CT_TextListStyle.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "p")
                {
                    ctObj.p.Add(CT_TextParagraph.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemple #2
0
        public static CT_DefaultShapeDefinition Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_DefaultShapeDefinition ctObj = new CT_DefaultShapeDefinition();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "spPr")
                {
                    ctObj.spPr = CT_ShapeProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "bodyPr")
                {
                    ctObj.bodyPr = CT_TextBodyProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lstStyle")
                {
                    ctObj.lstStyle = CT_TextListStyle.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "style")
                {
                    ctObj.style = CT_ShapeStyle.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Exemple #3
0
 public CT_DefaultShapeDefinition()
 {
     this.extLstField = new CT_OfficeArtExtensionList();
     this.styleField = new CT_ShapeStyle();
     this.lstStyleField = new CT_TextListStyle();
     this.bodyPrField = new CT_TextBodyProperties();
     this.spPrField = new CT_ShapeProperties();
 }
Exemple #4
0
 public CT_DefaultShapeDefinition()
 {
     this.extLstField   = new CT_OfficeArtExtensionList();
     this.styleField    = new CT_ShapeStyle();
     this.lstStyleField = new CT_TextListStyle();
     this.bodyPrField   = new CT_TextBodyProperties();
     this.spPrField     = new CT_ShapeProperties();
 }
Exemple #5
0
 public CT_TextBodyProperties AddNewBodyPr()
 {
     this.bodyPrField = new CT_TextBodyProperties();
     return this.bodyPrField;
 }
Exemple #6
0
 public static CT_TextBodyProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_TextBodyProperties ctObj = new CT_TextBodyProperties();
     ctObj.rot = XmlHelper.ReadInt(node.Attributes["rot"]);
     ctObj.spcFirstLastPara = XmlHelper.ReadBool(node.Attributes["spcFirstLastPara"]);
     if (node.Attributes["vertOverflow"] != null)
         ctObj.vertOverflow = (ST_TextVertOverflowType)Enum.Parse(typeof(ST_TextVertOverflowType), node.Attributes["vertOverflow"].Value);
     if (node.Attributes["horzOverflow"] != null)
         ctObj.horzOverflow = (ST_TextHorzOverflowType)Enum.Parse(typeof(ST_TextHorzOverflowType), node.Attributes["horzOverflow"].Value);
     if (node.Attributes["vert"] != null)
         ctObj.vert = (ST_TextVerticalType)Enum.Parse(typeof(ST_TextVerticalType), node.Attributes["vert"].Value);
     if (node.Attributes["wrap"] != null)
         ctObj.wrap = (ST_TextWrappingType)Enum.Parse(typeof(ST_TextWrappingType), node.Attributes["wrap"].Value);
     ctObj.lIns = XmlHelper.ReadInt(node.Attributes["lIns"]);
     ctObj.tIns = XmlHelper.ReadInt(node.Attributes["tIns"]);
     ctObj.rIns = XmlHelper.ReadInt(node.Attributes["rIns"]);
     ctObj.bIns = XmlHelper.ReadInt(node.Attributes["bIns"]);
     ctObj.numCol = XmlHelper.ReadInt(node.Attributes["numCol"]);
     ctObj.spcCol = XmlHelper.ReadInt(node.Attributes["spcCol"]);
     ctObj.rtlCol = XmlHelper.ReadBool(node.Attributes["rtlCol"]);
     ctObj.fromWordArt = XmlHelper.ReadBool(node.Attributes["fromWordArt"]);
     if (node.Attributes["anchor"] != null)
         ctObj.anchor = (ST_TextAnchoringType)Enum.Parse(typeof(ST_TextAnchoringType), node.Attributes["anchor"].Value);
     ctObj.anchorCtr = XmlHelper.ReadBool(node.Attributes["anchorCtr"]);
     ctObj.forceAA = XmlHelper.ReadBool(node.Attributes["forceAA"]);
     ctObj.upright = XmlHelper.ReadBool(node.Attributes["upright"]);
     ctObj.compatLnSpc = XmlHelper.ReadBool(node.Attributes["compatLnSpc"]);
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "prstTxWarp")
             ctObj.prstTxWarp = CT_PresetTextShape.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "noAutofit")
             ctObj.noAutofit = new CT_TextNoAutofit();
         else if (childNode.LocalName == "normAutofit")
             ctObj.normAutofit = CT_TextNormalAutofit.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "spAutoFit")
             ctObj.spAutoFit = new CT_TextShapeAutofit();
         else if (childNode.LocalName == "scene3d")
             ctObj.scene3d = CT_Scene3D.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "sp3d")
             ctObj.sp3d = CT_Shape3D.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "flatTx")
             ctObj.flatTx = CT_FlatText.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
     }
     return ctObj;
 }
Exemple #7
0
        public static CT_TextBodyProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextBodyProperties ctObj = new CT_TextBodyProperties();

            ctObj.rot = XmlHelper.ReadInt(node.Attributes["rot"]);
            ctObj.spcFirstLastPara = XmlHelper.ReadBool(node.Attributes["spcFirstLastPara"]);
            if (node.Attributes["vertOverflow"] != null)
            {
                ctObj.vertOverflow = (ST_TextVertOverflowType)Enum.Parse(typeof(ST_TextVertOverflowType), node.Attributes["vertOverflow"].Value);
            }
            if (node.Attributes["horzOverflow"] != null)
            {
                ctObj.horzOverflow = (ST_TextHorzOverflowType)Enum.Parse(typeof(ST_TextHorzOverflowType), node.Attributes["horzOverflow"].Value);
            }
            if (node.Attributes["vert"] != null)
            {
                ctObj.vert = (ST_TextVerticalType)Enum.Parse(typeof(ST_TextVerticalType), node.Attributes["vert"].Value);
            }
            if (node.Attributes["wrap"] != null)
            {
                ctObj.wrap = (ST_TextWrappingType)Enum.Parse(typeof(ST_TextWrappingType), node.Attributes["wrap"].Value);
            }
            ctObj.lIns        = XmlHelper.ReadInt(node.Attributes["lIns"]);
            ctObj.tIns        = XmlHelper.ReadInt(node.Attributes["tIns"]);
            ctObj.rIns        = XmlHelper.ReadInt(node.Attributes["rIns"]);
            ctObj.bIns        = XmlHelper.ReadInt(node.Attributes["bIns"]);
            ctObj.numCol      = XmlHelper.ReadInt(node.Attributes["numCol"]);
            ctObj.spcCol      = XmlHelper.ReadInt(node.Attributes["spcCol"]);
            ctObj.rtlCol      = XmlHelper.ReadBool(node.Attributes["rtlCol"]);
            ctObj.fromWordArt = XmlHelper.ReadBool(node.Attributes["fromWordArt"]);
            if (node.Attributes["anchor"] != null)
            {
                ctObj.anchor = (ST_TextAnchoringType)Enum.Parse(typeof(ST_TextAnchoringType), node.Attributes["anchor"].Value);
            }
            ctObj.anchorCtr   = XmlHelper.ReadBool(node.Attributes["anchorCtr"]);
            ctObj.forceAA     = XmlHelper.ReadBool(node.Attributes["forceAA"]);
            ctObj.upright     = XmlHelper.ReadBool(node.Attributes["upright"]);
            ctObj.compatLnSpc = XmlHelper.ReadBool(node.Attributes["compatLnSpc"]);
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "prstTxWarp")
                {
                    ctObj.prstTxWarp = CT_PresetTextShape.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "noAutofit")
                {
                    ctObj.noAutofit = new CT_TextNoAutofit();
                }
                else if (childNode.LocalName == "normAutofit")
                {
                    ctObj.normAutofit = CT_TextNormalAutofit.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "spAutoFit")
                {
                    ctObj.spAutoFit = new CT_TextShapeAutofit();
                }
                else if (childNode.LocalName == "scene3d")
                {
                    ctObj.scene3d = CT_Scene3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sp3d")
                {
                    ctObj.sp3d = CT_Shape3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "flatTx")
                {
                    ctObj.flatTx = CT_FlatText.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Exemple #8
0
 public CT_TextBodyProperties AddNewBodyPr()
 {
     this.bodyPrField = new CT_TextBodyProperties();
     return(this.bodyPrField);
 }