Ejemplo n.º 1
0
Archivo: Text.cs Proyecto: 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);
        }
Ejemplo n.º 2
0
        public static CT_TextParagraph Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextParagraph ctObj = new CT_TextParagraph();

            ctObj.r     = new List <CT_RegularTextRun>();
            ctObj.br    = new List <CT_TextLineBreak>();
            ctObj.fld   = new List <CT_TextField>();
            ctObj.items = new List <object>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "pPr")
                {
                    ctObj.pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                    ctObj.items.Add(ctObj.pPr);
                }
                else if (childNode.LocalName == "endParaRPr")
                {
                    ctObj.endParaRPr = CT_TextCharacterProperties.Parse(childNode, namespaceManager);
                    ctObj.items.Add(ctObj.endParaRPr);
                }
                else if (childNode.LocalName == "r")
                {
                    CT_RegularTextRun r = CT_RegularTextRun.Parse(childNode, namespaceManager);
                    ctObj.r.Add(r);
                    ctObj.items.Add(r);
                }
                else if (childNode.LocalName == "br")
                {
                    CT_TextLineBreak br = CT_TextLineBreak.Parse(childNode, namespaceManager);
                    ctObj.br.Add(br);
                    ctObj.items.Add(br);
                }
                else if (childNode.LocalName == "fld")
                {
                    CT_TextField fld = CT_TextField.Parse(childNode, namespaceManager);
                    ctObj.fld.Add(fld);
                    ctObj.items.Add(fld);
                }
            }
            return(ctObj);
        }
Ejemplo n.º 3
0
        public static CT_TextField Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TextField ctObj = new CT_TextField();

            ctObj.t    = XmlHelper.ReadString(node.Attributes["t"]);
            ctObj.id   = XmlHelper.ReadString(node.Attributes["id"]);
            ctObj.type = XmlHelper.ReadString(node.Attributes["type"]);
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "rPr")
                {
                    ctObj.rPr = CT_TextCharacterProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "pPr")
                {
                    ctObj.pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Ejemplo n.º 4
0
 public CT_TextParagraphProperties AddNewPPr()
 {
     this.pPrField = new CT_TextParagraphProperties();
     return this.pPrField;    
 }
Ejemplo n.º 5
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;
       }
Ejemplo n.º 6
0
 public CT_TextParagraphProperties AddNewPPr()
 {
     this.pPrField = new CT_TextParagraphProperties();
     return(this.pPrField);
 }
Ejemplo n.º 7
0
 public CT_TextField()
 {
     this.pPrField = new CT_TextParagraphProperties();
     this.rPrField = new CT_TextCharacterProperties();
 }
Ejemplo n.º 8
0
 public abstract bool Fetch(CT_TextParagraphProperties props);
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
0
 public CT_TextField()
 {
     this.pPrField = new CT_TextParagraphProperties();
     this.rPrField = new CT_TextCharacterProperties();
 }