Example #1
0
 public Category GetCategory(int categoryID)
 {
     var data = downloadWebPage(getFullUrl("admin/categories/" + categoryID + ".xml"), HttpMethod.GET);
     var x = XDocument.Parse(data).Root;
     var cat = new Category();
     cat.LoadXElement(x);
     return cat;
 }
Example #2
0
 public void UpdateCategory(Category category)
 {
     var data = downloadWebPage(getFullUrl("admin/categories/" + category.ID + ".xml"), HttpMethod.PUT, category.ToXElement().ToString());
     var x = XDocument.Parse(data).Root;
     category.LoadXElement(x);
 }
Example #3
0
 public IEnumerable<Category> GetCategories()
 {
     var data = downloadWebPage(getFullUrl("admin/categories.xml"), HttpMethod.GET);
     var x = XDocument.Parse(data);
     foreach (var item in x.Root.Elements())
     {
         var cat = new Category();
         cat.LoadXElement(item);
         yield return cat;
     }
 }