public void FetchCurrentBlogCategories() { if (null == CurrentBlog) { throw new ArgumentException("CurrentBlog may not be null", "CurrentBlog"); } GetCategoriesRPC rpc = new GetCategoriesRPC(CurrentBlog); rpc.Completed += OnGetCategoriesRPCCompleted; rpc.ExecuteAsync(); }
private void OnGetCategoriesRPCCompleted(object sender, XMLRPCCompletedEventArgs <Category> args) { GetCategoriesRPC rpc = sender as GetCategoriesRPC; rpc.Completed -= OnGetCategoriesRPCCompleted; if (null == args.Error) { CurrentBlog.Categories.Clear(); args.Items.ForEach(category => { CurrentBlog.Categories.Add(category); }); NotifyFetchComplete(); } else { NotifyExceptionOccurred(new ExceptionEventArgs(args.Error)); } }