コード例 #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            try
            {
                using (new WaitCursor())
                {
                    string newBlogId = WeblogConfigurationWizardController.Add(FindForm(), false);
                    if (newBlogId != null)
                    {
                        // add the weblog
                        using (BlogSettings blogSettings = BlogSettings.ForBlogId(newBlogId))
                        {
                            ListViewItem item = listViewWeblogs.AddWeblogItem(blogSettings);

                            // select the item that was added
                            listViewWeblogs.SelectedItems.Clear();
                            item.Selected = true;

                            // set focus to the list
                            listViewWeblogs.Focus();
                        }
                    }
                    return;
                }
            }
            catch (Exception ex)
            {
                UnexpectedErrorMessage.Show(ex);
            }
        }
コード例 #2
0
        public void GeneralPanel_RunAccountWizard()
        {
            var settingsCopy = TemporaryBlogSettings.CreateNew();

            settingsCopy.CopyFrom(_temporarySettings);
            SaveConfigToBlogSettings(settingsCopy);

            var result = WeblogConfigurationWizardController.EditTemporarySettings(formPreferences, settingsCopy);

            // If wizard is successful, load the new settings back into the form.
            if (result)
            {
                _temporarySettings.CopyFrom(settingsCopy);
                Config = StaticSiteConfig.LoadConfigFromBlogSettings(_temporarySettings);
                LoadConfigIntoPanels();
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        private static bool CreateInitialProfile(IDisposable splashScreen)
        {
            using (new WaitCursor())
            {
                if (splashScreen != null)
                {
                    splashScreen.Dispose();
                }

                if (WeblogConfigurationWizardController.Welcome(null) != null)
                {
                    // ensure we show the list of recent posts
                    PostListCache.Update();
                    WriterJumpList.Invalidate(IntPtr.Zero);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
コード例 #5
0
        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();
            }
        }