private AdferoArticlePhotoList ListArticlePhotos(int articleId, int offset, int limit, string[] properties, string[] fields) { string uri = this.GetUri(articleId, "articleId", "xml", properties, fields, offset, limit); uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty)); string xml = AdferoHelpers.GetXmlFromUri(uri); AdferoArticlePhotoList articlePhotos = this.ListArticlePhotosFromXmlString(xml); articlePhotos.Limit = limit; articlePhotos.Offset = offset; return(articlePhotos); }
private AdferoArticlePhotoList ListArticlePhotosFromXmlString(string xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); int totalCount = int.Parse(doc.SelectSingleNode("//articlePhotos").Attributes["totalCount"].Value); AdferoArticlePhotoList articlesPhotosList = new AdferoArticlePhotoList(); articlesPhotosList.TotalCount = totalCount; foreach (XmlNode n in doc.SelectNodes("//articlePhotos/articlePhoto")) { foreach (XmlNode na in n.SelectNodes("id")) { AdferoArticlePhotoListItem item = new AdferoArticlePhotoListItem(); item.Id = int.Parse(na.InnerText); articlesPhotosList.Items.Add(item); } } return(articlesPhotosList); }
private AdferoArticlePhotoList ListArticlePhotosFromXmlString(string xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); int totalCount = int.Parse(doc.SelectSingleNode("//articlePhotos").Attributes["totalCount"].Value); AdferoArticlePhotoList articlesPhotosList = new AdferoArticlePhotoList(); articlesPhotosList.TotalCount = totalCount; foreach (XmlNode n in doc.SelectNodes("//articlePhotos/articlePhoto")) { foreach (XmlNode na in n.SelectNodes("id")) { AdferoArticlePhotoListItem item = new AdferoArticlePhotoListItem(); item.Id = int.Parse(na.InnerText); articlesPhotosList.Items.Add(item); } } return articlesPhotosList; }