Exemple #1
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);
        }