public static CT_WorkbookPr Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_WorkbookPr ctObj = new CT_WorkbookPr(); ctObj.date1904 = XmlHelper.ReadBool(node.Attribute("date1904")); ctObj.date1904Specified = node.Attribute("date1904") != null; if (node.Attribute("showObjects") != null) { ctObj.showObjects = (ST_Objects)Enum.Parse(typeof(ST_Objects), node.Attribute("showObjects").Value); } ctObj.showBorderUnselectedTables = XmlHelper.ReadBool(node.Attribute("showBorderUnselectedTables"), true); ctObj.filterPrivacy = XmlHelper.ReadBool(node.Attribute("filterPrivacy")); ctObj.promptedSolutions = XmlHelper.ReadBool(node.Attribute("promptedSolutions")); ctObj.showInkAnnotation = XmlHelper.ReadBool(node.Attribute("showInkAnnotation"), true); ctObj.backupFile = XmlHelper.ReadBool(node.Attribute("backupFile")); ctObj.saveExternalLinkValues = XmlHelper.ReadBool(node.Attribute("saveExternalLinkValues"), true); if (node.Attribute("updateLinks") != null) { ctObj.updateLinks = (ST_UpdateLinks)Enum.Parse(typeof(ST_UpdateLinks), node.Attribute("updateLinks").Value); } ctObj.codeName = XmlHelper.ReadString(node.Attribute("codeName")); ctObj.hidePivotFieldList = XmlHelper.ReadBool(node.Attribute("hidePivotFieldList")); ctObj.showPivotChartFilter = XmlHelper.ReadBool(node.Attribute("showPivotChartFilter")); ctObj.allowRefreshQuery = XmlHelper.ReadBool(node.Attribute("allowRefreshQuery")); ctObj.publishItems = XmlHelper.ReadBool(node.Attribute("publishItems")); ctObj.checkCompatibility = XmlHelper.ReadBool(node.Attribute("checkCompatibility")); ctObj.autoCompressPictures = XmlHelper.ReadBool(node.Attribute("autoCompressPictures"), true); ctObj.refreshAllConnections = XmlHelper.ReadBool(node.Attribute("refreshAllConnections")); ctObj.defaultThemeVersion = XmlHelper.ReadUInt(node.Attribute("defaultThemeVersion")); return(ctObj); }
public static CT_Workbook Parse(XElement node, XmlNamespaceManager namespaceManager) { if (node == null) { return(null); } CT_Workbook ctObj = new CT_Workbook(); ctObj.fileRecoveryPr = new List <CT_FileRecoveryPr>(); foreach (XElement childNode in node.ChildElements()) { if (childNode.Name.LocalName == "fileVersion") { ctObj.fileVersion = CT_FileVersion.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "fileSharing") { ctObj.fileSharing = CT_FileSharing.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "workbookPr") { ctObj.workbookPr = CT_WorkbookPr.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "workbookProtection") { ctObj.workbookProtection = CT_WorkbookProtection.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "bookViews") { ctObj.bookViews = CT_BookViews.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "sheets") { ctObj.sheets = CT_Sheets.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "functionGroups") { ctObj.functionGroups = CT_FunctionGroups.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "externalReferences") { ctObj.externalReferences = CT_ExternalReferences.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "definedNames") { ctObj.definedNames = CT_DefinedNames.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "calcPr") { ctObj.calcPr = CT_CalcPr.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "oleSize") { ctObj.oleSize = CT_OleSize.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "customWorkbookViews") { ctObj.customWorkbookViews = CT_CustomWorkbookViews.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "pivotCaches") { ctObj.pivotCaches = CT_PivotCaches.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "smartTagPr") { ctObj.smartTagPr = CT_SmartTagPr.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "smartTagTypes") { ctObj.smartTagTypes = CT_SmartTagTypes.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "webPublishing") { ctObj.webPublishing = CT_WebPublishing.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "webPublishObjects") { ctObj.webPublishObjects = CT_WebPublishObjects.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "extLst") { ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager); } else if (childNode.Name.LocalName == "fileRecoveryPr") { ctObj.fileRecoveryPr.Add(CT_FileRecoveryPr.Parse(childNode, namespaceManager)); } } return(ctObj); }
public CT_WorkbookPr AddNewWorkbookPr() { this.workbookPrField = new CT_WorkbookPr(); return(this.workbookPrField); }