private XmlRpcArray GenerateNewCategoriesForPost(BlogPostCategory[] newCategories) { ArrayList categoryValues = new ArrayList(); foreach (BlogPostCategory category in newCategories) { // create the struct for the category XmlRpcStruct categoryStruct = new XmlRpcStruct(new XmlRpcMember[] { new XmlRpcMember( "description", category.Name ), new XmlRpcMember( "parent", category.Parent) }); // add it to the list categoryValues.Add(categoryStruct); } // return the array return new XmlRpcArray((XmlRpcValue[])categoryValues.ToArray(typeof(XmlRpcValue))); }
private XmlRpcArray GetCategoriesArray(BlogPostCategory[] categories) { ArrayList categoryValues = new ArrayList(); foreach (BlogPostCategory category in categories) { // create the struct for the category XmlRpcStruct categoryStruct = new XmlRpcStruct( new XmlRpcMember[] { new XmlRpcMember("categoryId", category.Id) }); // add it to the list categoryValues.Add(categoryStruct); } // return the array return new XmlRpcArray((XmlRpcValue[])categoryValues.ToArray(typeof(XmlRpcValue))); }