public static bool EditSettings(IWin32Window owner, TemporaryBlogSettings blogSettings, bool showAccountSettings, Type selectedPanel) { // make a copy of the blog settings for editing TemporaryBlogSettings editableBlogSettings = blogSettings.Clone() as TemporaryBlogSettings; // show form using (PreferencesForm preferencesForm = new PreferencesForm()) { using (BlogClientUIContextScope uiContextScope = new BlogClientUIContextScope(preferencesForm)) { // customize form title and behavior preferencesForm.Text = String.Format(CultureInfo.CurrentCulture, Res.Get(StringId.WeblogSettings), blogSettings.BlogName); preferencesForm.HideApplyButton(); // panels int iPanel = 0; if (showAccountSettings) { preferencesForm.SetEntry(iPanel++, new AccountPanel(blogSettings, editableBlogSettings)); } preferencesForm.SetEntry(iPanel++, new ImagesPanel(blogSettings, editableBlogSettings)); preferencesForm.SetEntry(iPanel++, new EditingPanel(blogSettings, editableBlogSettings)); preferencesForm.SetEntry(iPanel++, new BlogPluginsPanel(blogSettings, editableBlogSettings)); preferencesForm.SetEntry(iPanel++, new AdvancedPanel(blogSettings, editableBlogSettings)); preferencesForm.SelectEntry(selectedPanel); // show the dialog return(preferencesForm.ShowDialog(owner) == DialogResult.OK); } } }
private void buttonEditConfiguration_Click(object sender, EventArgs e) { // make a copy of the temporary settings to edit TemporaryBlogSettings blogSettings = TemporaryBlogSettings.Clone() as TemporaryBlogSettings; // edit account info if (WeblogConfigurationWizardController.EditTemporarySettings(FindForm(), blogSettings)) { // go ahead and save the settings back TemporaryBlogSettings.CopyFrom(blogSettings); // note that settings have been modified TemporaryBlogSettingsModified = true; // reset ui InitializeSettings(); } }
private void buttonEditConfiguration_Click(object sender, EventArgs e) { // make a copy of the temporary settings to edit TemporaryBlogSettings blogSettings = TemporaryBlogSettings.Clone() as TemporaryBlogSettings; // Edit account info // For static sites, the advanced configuration panel will be displayed // Otherwise, display the wizard bool settingsModified = blogSettings.IsStaticSiteBlog ? StaticSiteAdvanced.StaticSitePreferencesController.EditTemporarySettings(FindForm(), blogSettings) : WeblogConfigurationWizardController.EditTemporarySettings(FindForm(), blogSettings); if (settingsModified) { // go ahead and save the settings back TemporaryBlogSettings.CopyFrom(blogSettings); // note that settings have been modified TemporaryBlogSettingsModified = true; // reset ui InitializeSettings(); } }