コード例 #1
0
        private AdferoCategoryList ListCategoriesFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            int totalCount = int.Parse(doc.SelectSingleNode("//categories").Attributes["totalCount"].Value);
            AdferoCategoryList categoryItems = new AdferoCategoryList();

            categoryItems.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//categories/category"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoCategoryListItem category = new AdferoCategoryListItem();
                    category.Id = int.Parse(na.InnerText);
                    categoryItems.Items.Add(category);
                }
            }

            return(categoryItems);
        }
コード例 #2
0
        private AdferoCategoryList ListCategoriesFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
            int totalCount = int.Parse(doc.SelectSingleNode("//categories").Attributes["totalCount"].Value);
            AdferoCategoryList categoryItems = new AdferoCategoryList();
            categoryItems.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//categories/category"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoCategoryListItem category = new AdferoCategoryListItem();
                    category.Id = int.Parse(na.InnerText);
                    categoryItems.Items.Add(category);
                }
            }

            return categoryItems;
        }