Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public static CT_TableColumns Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TableColumns ctObj = new CT_TableColumns();

            if (node.Attribute("count") != null)
            {
                ctObj.count = XmlHelper.ReadUInt(node.Attribute("count"));
            }
            ctObj.tableColumn = new List <CT_TableColumn>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "tableColumn")
                {
                    ctObj.tableColumn.Add(CT_TableColumn.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }