예제 #1
0
        public static CT_TableStyleInfo Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TableStyleInfo ctObj = new CT_TableStyleInfo();

            ctObj.name = XmlHelper.ReadString(node.Attribute("name"));
            if (node.Attribute("showFirstColumn") != null)
            {
                ctObj.showFirstColumn = XmlHelper.ReadBool(node.Attribute("showFirstColumn"));
            }
            if (node.Attribute("showLastColumn") != null)
            {
                ctObj.showLastColumn = XmlHelper.ReadBool(node.Attribute("showLastColumn"));
            }
            if (node.Attribute("showRowStripes") != null)
            {
                ctObj.showRowStripes = XmlHelper.ReadBool(node.Attribute("showRowStripes"));
            }
            if (node.Attribute("showColumnStripes") != null)
            {
                ctObj.showColumnStripes = XmlHelper.ReadBool(node.Attribute("showColumnStripes"));
            }
            return(ctObj);
        }
예제 #2
0
파일: CT_Table.cs 프로젝트: xewn/Npoi.Core
        public static CT_Table Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Table ctObj = new CT_Table();

            if (node.Attribute("id") != null)
            {
                ctObj.id = XmlHelper.ReadUInt(node.Attribute("id"));
            }
            ctObj.name        = XmlHelper.ReadString(node.Attribute("name"));
            ctObj.displayName = XmlHelper.ReadString(node.Attribute("displayName"));
            ctObj.comment     = XmlHelper.ReadString(node.Attribute("comment"));
            ctObj.@ref        = XmlHelper.ReadString(node.Attribute("ref"));
            if (node.Attribute("tableType") != null)
            {
                ctObj.tableType = (ST_TableType)Enum.Parse(typeof(ST_TableType), node.Attribute("tableType").Value);
            }
            if (node.Attribute("headerRowCount") != null)
            {
                ctObj.headerRowCount = XmlHelper.ReadUInt(node.Attribute("headerRowCount"));
            }
            if (node.Attribute("insertRow") != null)
            {
                ctObj.insertRow = XmlHelper.ReadBool(node.Attribute("insertRow"));
            }
            if (node.Attribute("insertRowShift") != null)
            {
                ctObj.insertRowShift = XmlHelper.ReadBool(node.Attribute("insertRowShift"));
            }
            if (node.Attribute("totalsRowCount") != null)
            {
                ctObj.totalsRowCount = XmlHelper.ReadUInt(node.Attribute("totalsRowCount"));
            }
            if (node.Attribute("totalsRowShown") != null)
            {
                ctObj.totalsRowShown = XmlHelper.ReadBool(node.Attribute("totalsRowShown"));
            }
            if (node.Attribute("published") != null)
            {
                ctObj.published = XmlHelper.ReadBool(node.Attribute("published"));
            }
            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"));
            }
            if (node.Attribute("headerRowBorderDxfId") != null)
            {
                ctObj.headerRowBorderDxfId = XmlHelper.ReadUInt(node.Attribute("headerRowBorderDxfId"));
            }
            if (node.Attribute("tableBorderDxfId") != null)
            {
                ctObj.tableBorderDxfId = XmlHelper.ReadUInt(node.Attribute("tableBorderDxfId"));
            }
            if (node.Attribute("totalsRowBorderDxfId") != null)
            {
                ctObj.totalsRowBorderDxfId = XmlHelper.ReadUInt(node.Attribute("totalsRowBorderDxfId"));
            }
            ctObj.headerRowCellStyle = XmlHelper.ReadString(node.Attribute("headerRowCellStyle"));
            ctObj.dataCellStyle      = XmlHelper.ReadString(node.Attribute("dataCellStyle"));
            ctObj.totalsRowCellStyle = XmlHelper.ReadString(node.Attribute("totalsRowCellStyle"));
            if (node.Attribute("connectionId") != null)
            {
                ctObj.connectionId = XmlHelper.ReadUInt(node.Attribute("connectionId"));
            }
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "autoFilter")
                {
                    ctObj.autoFilter = CT_AutoFilter.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sortState")
                {
                    ctObj.sortState = CT_SortState.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "tableColumns")
                {
                    ctObj.tableColumns = CT_TableColumns.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "tableStyleInfo")
                {
                    ctObj.tableStyleInfo = CT_TableStyleInfo.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }