Ejemplo n.º 1
0
        public static CT_SheetBackgroundPicture Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_SheetBackgroundPicture ctObj = new CT_SheetBackgroundPicture();

            ctObj.id = XmlHelper.ReadString(node.Attribute((XNamespace)PackageNamespaces.SCHEMA_RELATIONSHIPS + "id"));
            return(ctObj);
        }
Ejemplo n.º 2
0
        public static CT_Worksheet Parse(XElement 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 (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "sheetPr")
                {
                    ctObj.sheetPr = CT_SheetPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "dimension")
                {
                    ctObj.dimension = CT_SheetDimension.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetViews")
                {
                    ctObj.sheetViews = CT_SheetViews.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetFormatPr")
                {
                    ctObj.sheetFormatPr = CT_SheetFormatPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetData")
                {
                    ctObj.sheetData = CT_SheetData.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetCalcPr")
                {
                    ctObj.sheetCalcPr = CT_SheetCalcPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetProtection")
                {
                    ctObj.sheetProtection = CT_SheetProtection.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "protectedRanges")
                {
                    ctObj.protectedRanges = CT_ProtectedRanges.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "scenarios")
                {
                    ctObj.scenarios = CT_Scenarios.Parse(childNode, namespaceManager);
                }
                else 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 == "dataConsolidate")
                {
                    ctObj.dataConsolidate = CT_DataConsolidate.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "customSheetViews")
                {
                    ctObj.customSheetViews = CT_CustomSheetViews.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "mergeCells")
                {
                    ctObj.mergeCells = CT_MergeCells.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "phoneticPr")
                {
                    ctObj.phoneticPr = CT_PhoneticPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "dataValidations")
                {
                    ctObj.dataValidations = CT_DataValidations.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "hyperlinks")
                {
                    ctObj.hyperlinks = CT_Hyperlinks.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "printOptions")
                {
                    ctObj.printOptions = CT_PrintOptions.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "pageMargins")
                {
                    ctObj.pageMargins = CT_PageMargins.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "pageSetup")
                {
                    ctObj.pageSetup = CT_PageSetup.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "headerFooter")
                {
                    ctObj.headerFooter = CT_HeaderFooter.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "rowBreaks")
                {
                    ctObj.rowBreaks = CT_PageBreak.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "colBreaks")
                {
                    ctObj.colBreaks = CT_PageBreak.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "customProperties")
                {
                    ctObj.customProperties = CT_CustomProperties.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "cellWatches")
                {
                    ctObj.cellWatches = CT_CellWatches.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "ignoredErrors")
                {
                    ctObj.ignoredErrors = CT_IgnoredErrors.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "smartTags")
                {
                    ctObj.smartTags = CT_CellSmartTags.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "drawing")
                {
                    ctObj.drawing = CT_Drawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "legacyDrawing")
                {
                    ctObj.legacyDrawing = CT_LegacyDrawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "legacyDrawingHF")
                {
                    ctObj.legacyDrawingHF = CT_LegacyDrawing.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "picture")
                {
                    ctObj.picture = CT_SheetBackgroundPicture.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "oleObjects")
                {
                    ctObj.oleObjects = CT_OleObjects.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "controls")
                {
                    ctObj.controls = CT_Controls.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "webPublishItems")
                {
                    ctObj.webPublishItems = CT_WebPublishItems.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "tableParts")
                {
                    ctObj.tableParts = CT_TableParts.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "cols")
                {
                    ctObj.cols.Add(CT_Cols.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "conditionalFormatting")
                {
                    ctObj.conditionalFormatting.Add(CT_ConditionalFormatting.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }