public static CT_XmlColumnPr Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_XmlColumnPr ctObj = new CT_XmlColumnPr(); if (node.Attribute("mapId") != null) { ctObj.mapId = XmlHelper.ReadUInt(node.Attribute("mapId")); } ctObj.xpath = XmlHelper.ReadString(node.Attribute("xpath")); if (node.Attribute("denormalized") != null) { ctObj.denormalized = XmlHelper.ReadBool(node.Attribute("denormalized")); } if (node.Attribute("xmlDataType") != null) { ctObj.xmlDataType = (ST_XmlDataType)Enum.Parse(typeof(ST_XmlDataType), node.Attribute("xmlDataType").Value); } foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }
public static CT_TableColumn Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_TableColumn ctObj = new CT_TableColumn(); if (node.Attribute("id") != null) { ctObj.id = XmlHelper.ReadUInt(node.Attribute("id")); } ctObj.uniqueName = XmlHelper.ReadString(node.Attribute("uniqueName")); ctObj.name = XmlHelper.ReadString(node.Attribute("name")); if (node.Attribute("totalsRowFunction") != null) { ctObj.totalsRowFunction = (ST_TotalsRowFunction)Enum.Parse(typeof(ST_TotalsRowFunction), node.Attribute("totalsRowFunction").Value); } ctObj.totalsRowLabel = XmlHelper.ReadString(node.Attribute("totalsRowLabel")); if (node.Attribute("queryTableFieldId") != null) { ctObj.queryTableFieldId = XmlHelper.ReadUInt(node.Attribute("queryTableFieldId")); } if (node.Attribute("headerRowDxfId") != null) { ctObj.headerRowDxfId = XmlHelper.ReadUInt(node.Attribute("headerRowDxfId")); } if (node.Attribute("dataDxfId") != null) { ctObj.dataDxfId = XmlHelper.ReadUInt(node.Attribute("dataDxfId")); } if (node.Attribute("totalsRowDxfId") != null) { ctObj.totalsRowDxfId = XmlHelper.ReadUInt(node.Attribute("totalsRowDxfId")); } ctObj.headerRowCellStyle = XmlHelper.ReadString(node.Attribute("headerRowCellStyle")); ctObj.dataCellStyle = XmlHelper.ReadString(node.Attribute("dataCellStyle")); ctObj.totalsRowCellStyle = XmlHelper.ReadString(node.Attribute("totalsRowCellStyle")); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "calculatedColumnFormula") { ctObj.calculatedColumnFormula = CT_TableFormula.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "totalsRowFormula") { ctObj.totalsRowFormula = CT_TableFormula.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "xmlColumnPr") { ctObj.xmlColumnPr = CT_XmlColumnPr.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } } return(ctObj); }