public CT_RegularTextRun AddNewR() { if (this.rField == null) { this.rField = new List <CT_RegularTextRun>(); } CT_RegularTextRun rtr = new CT_RegularTextRun(); this.rField.Add(rtr); this.itemsField.Add(rtr); return(rtr); }
public static CT_TextParagraph Parse(XElement 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 (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "pPr") { ctObj.pPr = CT_TextParagraphProperties.Parse(childNode, namespaceManager); ctObj.items.Add(ctObj.pPr); } else if (childNode.Name.LocalName == "endParaRPr") { ctObj.endParaRPr = CT_TextCharacterProperties.Parse(childNode, namespaceManager); ctObj.items.Add(ctObj.endParaRPr); } else if (childNode.Name.LocalName == "r") { CT_RegularTextRun r = CT_RegularTextRun.Parse(childNode, namespaceManager); ctObj.r.Add(r); ctObj.items.Add(r); } else if (childNode.Name.LocalName == "br") { CT_TextLineBreak br = CT_TextLineBreak.Parse(childNode, namespaceManager); ctObj.br.Add(br); ctObj.items.Add(br); } else if (childNode.Name.LocalName == "fld") { CT_TextField fld = CT_TextField.Parse(childNode, namespaceManager); ctObj.fld.Add(fld); ctObj.items.Add(fld); } } return(ctObj); }
public static CT_RegularTextRun Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_RegularTextRun ctObj = new CT_RegularTextRun(); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "rPr") { ctObj.rPr = CT_TextCharacterProperties.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "t") { ctObj.t = childNode.Value; } } return(ctObj); }