public IEnumerable<Collection> GetCollections() { var data = downloadWebPage(getFullUrl("admin/collections.xml"), HttpMethod.GET); var x = XDocument.Parse(data); foreach (var item in x.Root.Elements()) { var col = new Collection(); col.LoadXElement(item); yield return col; } }
public void AddCollection(Collection collection) { var data = downloadWebPage(getFullUrl("admin/collections.xml"), HttpMethod.POST, collection.ToXElement().ToString()); var x = XDocument.Parse(data).Root; collection.LoadXElement(x); }
public Collection GetCollection(int collectionID) { var data = downloadWebPage(getFullUrl("admin/collections/" + collectionID + ".xml"), HttpMethod.GET); var x = XDocument.Parse(data).Root; var col = new Collection(); col.LoadXElement(x); return col; }