示例#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);
        }
示例#2
0
        public static CT_TableFormula Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TableFormula ctObj = new CT_TableFormula();

            if (node.Attribute("array") != null)
            {
                ctObj.array = XmlHelper.ReadBool(node.Attribute("array"));
            }
            ctObj.Value = node.Value;
            return(ctObj);
        }