示例#1
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);
        }
示例#2
0
        public static CT_Backdrop Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Backdrop ctObj = new CT_Backdrop();

            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "anchor")
                {
                    ctObj.anchor = CT_Point3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "norm")
                {
                    ctObj.norm = CT_Vector3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "up")
                {
                    ctObj.up = CT_Vector3D.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#3
0
        public static CT_ObjectStyleDefaults Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_ObjectStyleDefaults ctObj = new CT_ObjectStyleDefaults();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "spDef")
                {
                    ctObj.spDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lnDef")
                {
                    ctObj.lnDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "txDef")
                {
                    ctObj.txDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#4
0
        public static CT_Scene3D Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Scene3D ctObj = new CT_Scene3D();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "camera")
                {
                    ctObj.camera = CT_Camera.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lightRig")
                {
                    ctObj.lightRig = CT_LightRig.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "backdrop")
                {
                    ctObj.backdrop = CT_Backdrop.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#5
0
文件: Text.cs 项目: zbl960/npoi
        public static CT_TextListStyle Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextListStyle ctObj = new CT_TextListStyle();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "defPPr")
                {
                    ctObj.defPPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl1pPr")
                {
                    ctObj.lvl1pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl2pPr")
                {
                    ctObj.lvl2pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl3pPr")
                {
                    ctObj.lvl3pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl4pPr")
                {
                    ctObj.lvl4pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl5pPr")
                {
                    ctObj.lvl5pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl6pPr")
                {
                    ctObj.lvl6pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl7pPr")
                {
                    ctObj.lvl7pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl8pPr")
                {
                    ctObj.lvl8pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "lvl9pPr")
                {
                    ctObj.lvl9pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#6
0
        public static CT_Shape3D Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Shape3D ctObj = new CT_Shape3D();

            ctObj.z          = XmlHelper.ReadLong(node.Attributes["z"]);
            ctObj.extrusionH = XmlHelper.ReadLong(node.Attributes["extrusionH"]);
            ctObj.contourW   = XmlHelper.ReadLong(node.Attributes["contourW"]);
            if (node.Attributes["prstMaterial"] != null)
            {
                ctObj.prstMaterial = (ST_PresetMaterialType)Enum.Parse(typeof(ST_PresetMaterialType), node.Attributes["prstMaterial"].Value);
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "bevelT")
                {
                    ctObj.bevelT = CT_Bevel.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "bevelB")
                {
                    ctObj.bevelB = CT_Bevel.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extrusionClr")
                {
                    ctObj.extrusionClr = CT_Color.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "contourClr")
                {
                    ctObj.contourClr = CT_Color.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#7
0
        public static CT_OfficeStyleSheet Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_OfficeStyleSheet ctObj = new CT_OfficeStyleSheet();

            ctObj.name       = XmlHelper.ReadString(node.Attributes["name"]);
            ctObj.custClrLst = new List <CT_CustomColor>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "themeElements")
                {
                    ctObj.themeElements = CT_BaseStyles.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "objectDefaults")
                {
                    ctObj.objectDefaults = CT_ObjectStyleDefaults.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extraClrSchemeLst")
                {
                    if (ctObj.extraClrSchemeLst == null)
                    {
                        ctObj.extraClrSchemeLst = new List <CT_ColorSchemeAndMapping>();
                    }
                    ctObj.extraClrSchemeLst.Add(CT_ColorSchemeAndMapping.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "custClrLst")
                {
                    ctObj.custClrLst.Add(CT_CustomColor.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
示例#8
0
        public static CT_NonVisualDrawingShapeProps Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_NonVisualDrawingShapeProps ctObj = new CT_NonVisualDrawingShapeProps();

            ctObj.txBox = XmlHelper.ReadBool(node.Attributes["txBox"]);
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "spLocks")
                {
                    ctObj.spLocks = CT_ShapeLocking.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
        public static CT_TextCharacterProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextCharacterProperties ctObj = new CT_TextCharacterProperties();

            ctObj.kumimoji = XmlHelper.ReadBool(node.Attributes["kumimoji"]);
            ctObj.lang     = XmlHelper.ReadString(node.Attributes["lang"]);
            ctObj.altLang  = XmlHelper.ReadString(node.Attributes["altLang"]);
            ctObj.sz       = XmlHelper.ReadInt(node.Attributes["sz"]);
            if (node.Attributes["b"] != null)
            {
                ctObj.b = XmlHelper.ReadBool(node.Attributes["b"]);
            }
            if (node.Attributes["i"] != null)
            {
                ctObj.i = XmlHelper.ReadBool(node.Attributes["i"]);
            }
            if (node.Attributes["u"] != null)
            {
                ctObj.u = (ST_TextUnderlineType)Enum.Parse(typeof(ST_TextUnderlineType), node.Attributes["u"].Value);
            }
            if (node.Attributes["strike"] != null)
            {
                ctObj.strike = (ST_TextStrikeType)Enum.Parse(typeof(ST_TextStrikeType), node.Attributes["strike"].Value);
            }
            ctObj.kern = XmlHelper.ReadInt(node.Attributes["kern"]);
            if (node.Attributes["cap"] != null)
            {
                ctObj.cap = (ST_TextCapsType)Enum.Parse(typeof(ST_TextCapsType), node.Attributes["cap"].Value);
            }
            ctObj.spc        = XmlHelper.ReadInt(node.Attributes["spc"]);
            ctObj.normalizeH = XmlHelper.ReadBool(node.Attributes["normalizeH"]);
            ctObj.baseline   = XmlHelper.ReadInt(node.Attributes["baseline"]);
            ctObj.noProof    = XmlHelper.ReadBool(node.Attributes["noProof"]);
            if (node.Attributes["dirty"] != null)
            {
                ctObj.dirty = XmlHelper.ReadBool(node.Attributes["dirty"]);
            }
            ctObj.err = XmlHelper.ReadBool(node.Attributes["err"]);
            if (node.Attributes["smtClean"] != null)
            {
                ctObj.smtClean = XmlHelper.ReadBool(node.Attributes["smtClean"]);
            }
            ctObj.smtId = XmlHelper.ReadUInt(node.Attributes["smtId"]);
            ctObj.bmk   = XmlHelper.ReadString(node.Attributes["bmk"]);
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "ln")
                {
                    ctObj.ln = CT_LineProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "noFill")
                {
                    ctObj.noFill = new CT_NoFillProperties();
                }
                else if (childNode.LocalName == "solidFill")
                {
                    ctObj.solidFill = CT_SolidColorFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "gradFill")
                {
                    ctObj.gradFill = CT_GradientFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "blipFill")
                {
                    ctObj.blipFill = CT_BlipFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "pattFill")
                {
                    ctObj.pattFill = CT_PatternFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "grpFill")
                {
                    ctObj.grpFill = new CT_GroupFillProperties();
                }
                else if (childNode.LocalName == "effectLst")
                {
                    ctObj.effectLst = CT_EffectList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "effectDag")
                {
                    ctObj.effectDag = CT_EffectContainer.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "highlight")
                {
                    ctObj.highlight = CT_Color.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "uLnTx")
                {
                    ctObj.uLnTx = new CT_TextUnderlineLineFollowText();
                }
                else if (childNode.LocalName == "uLn")
                {
                    ctObj.uLn = CT_LineProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "uFillTx")
                {
                    ctObj.uFillTx = new CT_TextUnderlineFillFollowText();
                }
                else if (childNode.LocalName == "uFill")
                {
                    ctObj.uFill = CT_TextUnderlineFillGroupWrapper.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "latin")
                {
                    ctObj.latin = CT_TextFont.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "ea")
                {
                    ctObj.ea = CT_TextFont.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "cs")
                {
                    ctObj.cs = CT_TextFont.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sym")
                {
                    ctObj.sym = CT_TextFont.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "hlinkClick")
                {
                    ctObj.hlinkClick = CT_Hyperlink.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "hlinkMouseOver")
                {
                    ctObj.hlinkMouseOver = CT_Hyperlink.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#10
0
        public static CT_ColorMapping Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_ColorMapping ctObj = new CT_ColorMapping();

            if (node.Attributes["bg1"] != null)
            {
                ctObj.bg1 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["bg1"].Value);
            }
            if (node.Attributes["tx1"] != null)
            {
                ctObj.tx1 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["tx1"].Value);
            }
            if (node.Attributes["bg2"] != null)
            {
                ctObj.bg2 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["bg2"].Value);
            }
            if (node.Attributes["tx2"] != null)
            {
                ctObj.tx2 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["tx2"].Value);
            }
            if (node.Attributes["accent1"] != null)
            {
                ctObj.accent1 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent1"].Value);
            }
            if (node.Attributes["accent2"] != null)
            {
                ctObj.accent2 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent2"].Value);
            }
            if (node.Attributes["accent3"] != null)
            {
                ctObj.accent3 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent3"].Value);
            }
            if (node.Attributes["accent4"] != null)
            {
                ctObj.accent4 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent4"].Value);
            }
            if (node.Attributes["accent5"] != null)
            {
                ctObj.accent5 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent5"].Value);
            }
            if (node.Attributes["accent6"] != null)
            {
                ctObj.accent6 = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["accent6"].Value);
            }
            if (node.Attributes["hlink"] != null)
            {
                ctObj.hlink = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["hlink"].Value);
            }
            if (node.Attributes["folHlink"] != null)
            {
                ctObj.folHlink = (ST_ColorSchemeIndex)Enum.Parse(typeof(ST_ColorSchemeIndex), node.Attributes["folHlink"].Value);
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
示例#11
0
        public static CT_LineProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_LineProperties ctObj = new CT_LineProperties();

            ctObj.w = XmlHelper.ReadInt(node.Attributes["w"]);
            if (node.Attributes["cap"] != null)
            {
                ctObj.cap = (ST_LineCap)Enum.Parse(typeof(ST_LineCap), node.Attributes["cap"].Value);
            }
            if (node.Attributes["cmpd"] != null)
            {
                ctObj.cmpd = (ST_CompoundLine)Enum.Parse(typeof(ST_CompoundLine), node.Attributes["cmpd"].Value);
            }
            if (node.Attributes["algn"] != null)
            {
                ctObj.algn = (ST_PenAlignment)Enum.Parse(typeof(ST_PenAlignment), node.Attributes["algn"].Value);
            }
            ctObj.custDash = new List <CT_DashStop>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "noFill")
                {
                    ctObj.noFill = new CT_NoFillProperties();
                }
                else if (childNode.LocalName == "solidFill")
                {
                    ctObj.solidFill = CT_SolidColorFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "gradFill")
                {
                    ctObj.gradFill = CT_GradientFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "pattFill")
                {
                    ctObj.pattFill = CT_PatternFillProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "prstDash")
                {
                    ctObj.prstDash = CT_PresetLineDashProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "round")
                {
                    ctObj.round = new CT_LineJoinRound();
                }
                else if (childNode.LocalName == "bevel")
                {
                    ctObj.bevel = new CT_LineJoinBevel();
                }
                else if (childNode.LocalName == "miter")
                {
                    ctObj.miter = CT_LineJoinMiterProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "headEnd")
                {
                    ctObj.headEnd = CT_LineEndProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "tailEnd")
                {
                    ctObj.tailEnd = CT_LineEndProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "custDash")
                {
                    ctObj.custDash.Add(CT_DashStop.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
示例#12
0
文件: Text.cs 项目: zbl960/npoi
        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);
        }
示例#13
0
        public static CT_TextParagraphProperties Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextParagraphProperties ctObj = new CT_TextParagraphProperties();

            ctObj.marL   = XmlHelper.ReadInt(node.Attributes["marL"]);
            ctObj.marR   = XmlHelper.ReadInt(node.Attributes["marR"]);
            ctObj.lvl    = XmlHelper.ReadInt(node.Attributes["lvl"]);
            ctObj.indent = XmlHelper.ReadInt(node.Attributes["indent"]);
            if (node.Attributes["algn"] != null)
            {
                ctObj.algn = (ST_TextAlignType)Enum.Parse(typeof(ST_TextAlignType), node.Attributes["algn"].Value);
            }
            else
            {
                ctObj.algn = ST_TextAlignType.l;
            }
            ctObj.defTabSz = XmlHelper.ReadInt(node.Attributes["defTabSz"]);
            ctObj.rtl      = XmlHelper.ReadBool(node.Attributes["rtl"]);
            ctObj.eaLnBrk  = XmlHelper.ReadBool(node.Attributes["eaLnBrk"]);
            if (node.Attributes["fontAlgn"] != null)
            {
                ctObj.fontAlgn = (ST_TextFontAlignType)Enum.Parse(typeof(ST_TextFontAlignType), node.Attributes["fontAlgn"].Value);
            }
            ctObj.latinLnBrk   = XmlHelper.ReadBool(node.Attributes["latinLnBrk"]);
            ctObj.hangingPunct = XmlHelper.ReadBool(node.Attributes["hangingPunct"]);

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "lnSpc")
                {
                    ctObj.lnSpc = CT_TextSpacing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "spcBef")
                {
                    ctObj.spcBef = CT_TextSpacing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "spcAft")
                {
                    ctObj.spcAft = CT_TextSpacing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buClrTx")
                {
                    ctObj.buClrTx = new CT_TextBulletColorFollowText();
                }
                else if (childNode.LocalName == "buClr")
                {
                    ctObj.buClr = CT_Color.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buSzTx")
                {
                    ctObj.buSzTx = new CT_TextBulletSizeFollowText();
                }
                else if (childNode.LocalName == "buSzPct")
                {
                    ctObj.buSzPct = CT_TextBulletSizePercent.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buSzPts")
                {
                    ctObj.buSzPts = CT_TextBulletSizePoint.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buFontTx")
                {
                    ctObj.buFontTx = new CT_TextBulletTypefaceFollowText();
                }
                else if (childNode.LocalName == "buFont")
                {
                    ctObj.buFont = CT_TextFont.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buNone")
                {
                    ctObj.buNone = new CT_TextNoBullet();
                }
                else if (childNode.LocalName == "buAutoNum")
                {
                    ctObj.buAutoNum = CT_TextAutonumberBullet.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buChar")
                {
                    ctObj.buChar = CT_TextCharBullet.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "buBlip")
                {
                    ctObj.buBlip = CT_TextBlipBullet.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "defRPr")
                {
                    ctObj.defRPr = CT_TextCharacterProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "tabLst")
                {
                    ctObj.tabLst = CT_TextTabStopList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }