Exemplo n.º 1
0
        private AdferoBriefList ListBriefsFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(xml);
            int             totalCount = int.Parse(doc.SelectSingleNode("//briefs").Attributes["totalCount"].Value);
            AdferoBriefList briefItems = new AdferoBriefList();

            briefItems.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//briefs/brief"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoBriefListItem brief = new AdferoBriefListItem();
                    brief.Id = int.Parse(na.InnerText);
                    briefItems.Items.Add(brief);
                }
            }

            return(briefItems);
        }
        private AdferoBriefList ListBriefsFromXmlString(string xml)
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);
            int totalCount = int.Parse(doc.SelectSingleNode("//briefs").Attributes["totalCount"].Value);
            AdferoBriefList briefItems = new AdferoBriefList();
            briefItems.TotalCount = totalCount;

            foreach (XmlNode n in doc.SelectNodes("//briefs/brief"))
            {
                foreach (XmlNode na in n.SelectNodes("id"))
                {
                    AdferoBriefListItem brief = new AdferoBriefListItem();
                    brief.Id = int.Parse(na.InnerText);
                    briefItems.Items.Add(brief);
                }
            }

            return briefItems;
        }