Example #1
0
        internal static CT_ExternalBook Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_ExternalBook ctObj = new CT_ExternalBook();

            ctObj.idField = XmlHelper.ReadString(node.Attribute((XNamespace)namespaceManager.LookupNamespace("r") + "id"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "sheetNames")
                {
                    ctObj.sheetNamesField = CT_ExternalSheetNames.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "definedNames")
                {
                    ctObj.definedNamesField = CT_ExternalDefinedNames.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sheetDataSet")
                {
                    ctObj.sheetDataSetField = CT_ExternalSheetDataSet.Parse(childNode, namespaceManager);
                }
            }

            return(ctObj);
        }
Example #2
0
        public static CT_ExternalLink Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_ExternalLink ctObj = new CT_ExternalLink();

            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "externalBook")
                {
                    ctObj.externalBookField = CT_ExternalBook.Parse(childNode, namespaceManager);
                    ctObj.itemField         = ctObj.externalBookField;
                    ctObj.itemType          = ExternalLinkItem.externalBook;
                }
                else if (childNode.Name.LocalName == "ddeLink")
                {
                    ctObj.ddeLinkField = CT_DdeLink.Parse(childNode, namespaceManager);
                    ctObj.itemField    = ctObj.ddeLinkField;
                    ctObj.itemType     = ExternalLinkItem.ddeLink;
                }
                else if (childNode.Name.LocalName == "oleLink")
                {
                    ctObj.oleLinkField = CT_OleLink.Parse(childNode, namespaceManager);
                    ctObj.itemField    = ctObj.oleLinkField;
                    ctObj.itemType     = ExternalLinkItem.oleLink;
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLstField = CT_ExtensionList.Parse(childNode, namespaceManager);
                    ctObj.itemField   = ctObj.extLstField;
                    ctObj.itemType    = ExternalLinkItem.extLst;
                }
            }
            return(ctObj);
        }
Example #3
0
 public void AddNewExternalBook()
 {
     this.externalBookField = new CT_ExternalBook();
 }