public void OnBlogChanged(Blog newBlog) { _clientOptions = newBlog.ClientOptions; _targetBlog = newBlog; controller.OnBlogChanged(newBlog); ((IBlogPostEditor)postPropertiesForm).OnBlogChanged(newBlog); ManageLayout(); }
void IBlogPostEditor.OnBlogChanged(Blog newBlog) { // preserve dirty state using (controller.SuspendLogic()) { _blogId = newBlog.Id; controller.OnBlogChanged(newBlog); // Clear out author whenever blog changes SetAuthor(PostIdAndNameField.Empty); // Comment policy hackery BlogCommentPolicy?commentPolicy = null; if (comboComments.SelectedIndex >= 0) { commentPolicy = ((CommentComboItem)comboComments.SelectedItem).Value; } comboComments.Items.Remove(new CommentComboItem(BlogCommentPolicy.None)); if (!newBlog.ClientOptions.CommentPolicyAsBoolean) { comboComments.Items.Insert(1, new CommentComboItem(BlogCommentPolicy.None)); } if (commentPolicy != null) { comboComments.SelectedItem = new CommentComboItem(commentPolicy.Value); } if (comboComments.SelectedIndex == -1) // In no case should there be no selection at all { comboComments.SelectedIndex = 0; } labelTags.Text = newBlog.ClientOptions.KeywordsAsTags ? Res.Get(StringId.PropertiesTags) : Res.Get(StringId.PropertiesKeywords); } }