Exemplo n.º 1
0
        public static CT_AutoFilter Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_AutoFilter ctObj = new CT_AutoFilter();

            ctObj.@ref         = XmlHelper.ReadString(node.Attributes["ref"]);
            ctObj.filterColumn = new List <CT_FilterColumn>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "sortState")
                {
                    ctObj.sortState = CT_SortState.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "filterColumn")
                {
                    ctObj.filterColumn.Add(CT_FilterColumn.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemplo n.º 2
0
        public static CT_SortState Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_SortState ctObj = new CT_SortState();

            ctObj.columnSort    = XmlHelper.ReadBool(node.Attributes["columnSort"]);
            ctObj.caseSensitive = XmlHelper.ReadBool(node.Attributes["caseSensitive"]);
            if (node.Attributes["sortMethod"] != null)
            {
                ctObj.sortMethod = (ST_SortMethod)Enum.Parse(typeof(ST_SortMethod), node.Attributes["sortMethod"].Value);
            }
            ctObj.@ref          = XmlHelper.ReadString(node.Attributes["ref"]);
            ctObj.sortCondition = new List <CT_SortCondition>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sortCondition")
                {
                    ctObj.sortCondition.Add(CT_SortCondition.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemplo n.º 3
0
        public static CT_Worksheet Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Worksheet ctObj = new CT_Worksheet();

            ctObj.cols = new List <CT_Cols>();
            ctObj.conditionalFormatting = new List <CT_ConditionalFormatting>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "sheetPr")
                {
                    ctObj.sheetPr = CT_SheetPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "dimension")
                {
                    ctObj.dimension = CT_SheetDimension.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sheetViews")
                {
                    ctObj.sheetViews = CT_SheetViews.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sheetFormatPr")
                {
                    ctObj.sheetFormatPr = CT_SheetFormatPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sheetData")
                {
                    ctObj.sheetData = CT_SheetData.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sheetCalcPr")
                {
                    ctObj.sheetCalcPr = CT_SheetCalcPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sheetProtection")
                {
                    ctObj.sheetProtection = CT_SheetProtection.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "protectedRanges")
                {
                    ctObj.protectedRanges = CT_ProtectedRanges.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "scenarios")
                {
                    ctObj.scenarios = CT_Scenarios.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "autoFilter")
                {
                    ctObj.autoFilter = CT_AutoFilter.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sortState")
                {
                    ctObj.sortState = CT_SortState.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "dataConsolidate")
                {
                    ctObj.dataConsolidate = CT_DataConsolidate.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "customSheetViews")
                {
                    ctObj.customSheetViews = CT_CustomSheetViews.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "mergeCells")
                {
                    ctObj.mergeCells = CT_MergeCells.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "phoneticPr")
                {
                    ctObj.phoneticPr = CT_PhoneticPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "dataValidations")
                {
                    ctObj.dataValidations = CT_DataValidations.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "hyperlinks")
                {
                    ctObj.hyperlinks = CT_Hyperlinks.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "printOptions")
                {
                    ctObj.printOptions = CT_PrintOptions.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "pageMargins")
                {
                    ctObj.pageMargins = CT_PageMargins.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "pageSetup")
                {
                    ctObj.pageSetup = CT_PageSetup.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "headerFooter")
                {
                    ctObj.headerFooter = CT_HeaderFooter.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "rowBreaks")
                {
                    ctObj.rowBreaks = CT_PageBreak.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "colBreaks")
                {
                    ctObj.colBreaks = CT_PageBreak.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "customProperties")
                {
                    ctObj.customProperties = CT_CustomProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "cellWatches")
                {
                    ctObj.cellWatches = CT_CellWatches.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "ignoredErrors")
                {
                    ctObj.ignoredErrors = CT_IgnoredErrors.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "smartTags")
                {
                    ctObj.smartTags = CT_CellSmartTags.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "drawing")
                {
                    ctObj.drawing = CT_Drawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "legacyDrawing")
                {
                    ctObj.legacyDrawing = CT_LegacyDrawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "legacyDrawingHF")
                {
                    ctObj.legacyDrawingHF = CT_LegacyDrawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "picture")
                {
                    ctObj.picture = CT_SheetBackgroundPicture.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "oleObjects")
                {
                    ctObj.oleObjects = CT_OleObjects.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "controls")
                {
                    ctObj.controls = CT_Controls.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "webPublishItems")
                {
                    ctObj.webPublishItems = CT_WebPublishItems.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "tableParts")
                {
                    ctObj.tableParts = CT_TableParts.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "cols")
                {
                    ctObj.cols.Add(CT_Cols.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "conditionalFormatting")
                {
                    ctObj.conditionalFormatting.Add(CT_ConditionalFormatting.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemplo n.º 4
0
 public CT_Macrosheet()
 {
     this.extLstField = new CT_ExtensionList();
     this.oleObjectsField = new List<CT_OleObject>();
     this.pictureField = new CT_SheetBackgroundPicture();
     this.legacyDrawingHFField = new CT_LegacyDrawing();
     this.legacyDrawingField = new CT_LegacyDrawing();
     this.drawingField = new CT_Drawing();
     this.customPropertiesField = new List<CT_CustomProperty>();
     this.colBreaksField = new CT_PageBreak();
     this.rowBreaksField = new CT_PageBreak();
     this.headerFooterField = new CT_HeaderFooter();
     this.pageSetupField = new CT_PageSetup();
     this.pageMarginsField = new CT_PageMargins();
     this.printOptionsField = new CT_PrintOptions();
     this.conditionalFormattingField = new List<CT_ConditionalFormatting>();
     this.phoneticPrField = new CT_PhoneticPr();
     this.customSheetViewsField = new List<CT_CustomSheetView>();
     this.dataConsolidateField = new CT_DataConsolidate();
     this.sortStateField = new CT_SortState();
     this.autoFilterField = new CT_AutoFilter();
     this.sheetProtectionField = new CT_SheetProtection();
     this.sheetDataField = new List<CT_Row>();
     this.colsField = new List<CT_Col>();
     this.sheetFormatPrField = new CT_SheetFormatPr();
     this.sheetViewsField = new CT_SheetViews();
     this.dimensionField = new CT_SheetDimension();
     this.sheetPrField = new CT_SheetPr();
 }
Exemplo n.º 5
0
 public static CT_SortState Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_SortState ctObj = new CT_SortState();
     if (node.Attributes["columnSort"] != null)
         ctObj.columnSort = XmlHelper.ReadBool(node.Attributes["columnSort"]);
     if (node.Attributes["caseSensitive"] != null)
         ctObj.caseSensitive = XmlHelper.ReadBool(node.Attributes["caseSensitive"]);
     if (node.Attributes["sortMethod"] != null)
         ctObj.sortMethod = (ST_SortMethod)Enum.Parse(typeof(ST_SortMethod), node.Attributes["sortMethod"].Value);
     ctObj.@ref = XmlHelper.ReadString(node.Attributes["ref"]);
     ctObj.sortCondition = new List<CT_SortCondition>();
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "sortCondition")
             ctObj.sortCondition.Add(CT_SortCondition.Parse(childNode, namespaceManager));
     }
     return ctObj;
 }
Exemplo n.º 6
0
        public static CT_Table Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Table ctObj = new CT_Table();

            if (node.Attributes["id"] != null)
            {
                ctObj.id = XmlHelper.ReadUInt(node.Attributes["id"]);
            }
            ctObj.name        = XmlHelper.ReadString(node.Attributes["name"]);
            ctObj.displayName = XmlHelper.ReadString(node.Attributes["displayName"]);
            ctObj.comment     = XmlHelper.ReadString(node.Attributes["comment"]);
            ctObj.@ref        = XmlHelper.ReadString(node.Attributes["ref"]);
            if (node.Attributes["tableType"] != null)
            {
                ctObj.tableType = (ST_TableType)Enum.Parse(typeof(ST_TableType), node.Attributes["tableType"].Value);
            }
            if (node.Attributes["headerRowCount"] != null)
            {
                ctObj.headerRowCount = XmlHelper.ReadUInt(node.Attributes["headerRowCount"]);
            }
            if (node.Attributes["insertRow"] != null)
            {
                ctObj.insertRow = XmlHelper.ReadBool(node.Attributes["insertRow"]);
            }
            if (node.Attributes["insertRowShift"] != null)
            {
                ctObj.insertRowShift = XmlHelper.ReadBool(node.Attributes["insertRowShift"]);
            }
            if (node.Attributes["totalsRowCount"] != null)
            {
                ctObj.totalsRowCount = XmlHelper.ReadUInt(node.Attributes["totalsRowCount"]);
            }
            if (node.Attributes["totalsRowShown"] != null)
            {
                ctObj.totalsRowShown = XmlHelper.ReadBool(node.Attributes["totalsRowShown"]);
            }
            if (node.Attributes["published"] != null)
            {
                ctObj.published = XmlHelper.ReadBool(node.Attributes["published"]);
            }
            if (node.Attributes["headerRowDxfId"] != null)
            {
                ctObj.headerRowDxfId = XmlHelper.ReadUInt(node.Attributes["headerRowDxfId"]);
            }
            if (node.Attributes["dataDxfId"] != null)
            {
                ctObj.dataDxfId = XmlHelper.ReadUInt(node.Attributes["dataDxfId"]);
            }
            if (node.Attributes["totalsRowDxfId"] != null)
            {
                ctObj.totalsRowDxfId = XmlHelper.ReadUInt(node.Attributes["totalsRowDxfId"]);
            }
            if (node.Attributes["headerRowBorderDxfId"] != null)
            {
                ctObj.headerRowBorderDxfId = XmlHelper.ReadUInt(node.Attributes["headerRowBorderDxfId"]);
            }
            if (node.Attributes["tableBorderDxfId"] != null)
            {
                ctObj.tableBorderDxfId = XmlHelper.ReadUInt(node.Attributes["tableBorderDxfId"]);
            }
            if (node.Attributes["totalsRowBorderDxfId"] != null)
            {
                ctObj.totalsRowBorderDxfId = XmlHelper.ReadUInt(node.Attributes["totalsRowBorderDxfId"]);
            }
            ctObj.headerRowCellStyle = XmlHelper.ReadString(node.Attributes["headerRowCellStyle"]);
            ctObj.dataCellStyle      = XmlHelper.ReadString(node.Attributes["dataCellStyle"]);
            ctObj.totalsRowCellStyle = XmlHelper.ReadString(node.Attributes["totalsRowCellStyle"]);
            if (node.Attributes["connectionId"] != null)
            {
                ctObj.connectionId = XmlHelper.ReadUInt(node.Attributes["connectionId"]);
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "autoFilter")
                {
                    ctObj.autoFilter = CT_AutoFilter.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "sortState")
                {
                    ctObj.sortState = CT_SortState.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "tableColumns")
                {
                    ctObj.tableColumns = CT_TableColumns.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "tableStyleInfo")
                {
                    ctObj.tableStyleInfo = CT_TableStyleInfo.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }