Ejemplo n.º 1
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.º 2
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.º 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;
 }