public void SetBlogInfo(BlogInfo blogInfo) { if (blogInfo.Id != _hostBlogId) { _blogName = blogInfo.Name; _hostBlogId = blogInfo.Id; _homePageUrl = blogInfo.HomepageUrl; if (!UrlHelper.IsUrl(_homePageUrl)) { Trace.Assert(!string.IsNullOrEmpty(_homePageUrl), "Homepage URL was null or empty"); string baseUrl = UrlHelper.GetBaseUrl(_postApiUrl); _homePageUrl = UrlHelper.UrlCombineIfRelative(baseUrl, _homePageUrl); } // reset categories, authors, and pages Categories = new BlogPostCategory[] { }; Keywords = new BlogPostKeyword[] { }; Authors = new AuthorInfo[] { }; Pages = new PageInfo[] { }; // reset option overrides if (OptionOverrides != null) OptionOverrides.Clear(); if (UserOptionOverrides != null) UserOptionOverrides.Clear(); if (HomePageOverrides != null) HomePageOverrides.Clear(); // reset provider buttons if (ButtonDescriptions != null) ButtonDescriptions = new IBlogProviderButtonDescription[0]; // reset template TemplateFiles = new BlogEditingTemplateFile[0]; } }
private object[] ConvertAuthors(AuthorInfo[] authorList) { ArrayList authors = new ArrayList(); foreach (AuthorInfo author in authorList) { authors.Add(new PostIdAndNameField(author.Id, author.Name)); } return authors.ToArray(); }