public static CT_PresetTextShape Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_PresetTextShape ctObj = new CT_PresetTextShape(); if (node.Attributes["prst"] != null) { ctObj.prst = (ST_TextShapeType)Enum.Parse(typeof(ST_TextShapeType), node.Attributes["prst"].Value); } ctObj.avLst = new List <CT_GeomGuide>(); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == "avLst") { ctObj.avLst.Add(CT_GeomGuide.Parse(childNode, namespaceManager)); } } return(ctObj); }
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); }
public static CT_PresetTextShape Parse(XmlNode node, XmlNamespaceManager namespaceManager) { if (node == null) return null; CT_PresetTextShape ctObj = new CT_PresetTextShape(); if (node.Attributes["prst"] != null) ctObj.prst = (ST_TextShapeType)Enum.Parse(typeof(ST_TextShapeType), node.Attributes["prst"].Value); ctObj.avLst = new List<CT_GeomGuide>(); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == "avLst") ctObj.avLst.Add(CT_GeomGuide.Parse(childNode, namespaceManager)); } return ctObj; }