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

            if (node.Attribute("count") != null)
            {
                ctObj.count = XmlHelper.ReadUInt(node.Attribute("count"));
            }
            ctObj.r = new List <Object>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "n")
                {
                    ctObj.r.Add(CT_Number.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "b")
                {
                    ctObj.r.Add(CT_Boolean.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "d")
                {
                    ctObj.r.Add(CT_DateTime.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "e")
                {
                    ctObj.r.Add(CT_Error.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "m")
                {
                    ctObj.r.Add(CT_Missing.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "s")
                {
                    ctObj.r.Add(CT_String.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "x")
                {
                    ctObj.r.Add(CT_Index.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Esempio n. 2
0
        public static CT_PivotCacheRecord Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            CT_PivotCacheRecord ctObj = new CT_PivotCacheRecord();

            ctObj.fields = new List <object>();

            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "n")
                {
                    ctObj.fields.Add(CT_Number.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "b")
                {
                    ctObj.fields.Add(CT_Boolean.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "d")
                {
                    ctObj.fields.Add(CT_DateTime.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "e")
                {
                    ctObj.fields.Add(CT_Error.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "m")
                {
                    ctObj.fields.Add(CT_Missing.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "s")
                {
                    ctObj.fields.Add(CT_String.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "x")
                {
                    ctObj.fields.Add(CT_Index.Parse(childNode, namespaceManager));
                }
            }

            return(ctObj);
        }