コード例 #1
0
        public void Save()
        {
            if (Account1Colour == Brushes.Green)
            {
                var accountConfig = new AccountConfig()
                {
                    EmailAddress = Account1,
                    DisplayName  = Account1Displayname,
                    DisplayIndex = 1,
                    IsConfigured = true,
                    SearchTag    = this.SearchTag
                };

                Bootstrapper.ApplicationConfiguration.Accounts.Add(accountConfig);
            }

            if (Account2Colour == Brushes.Green)
            {
                var accountConfig = new AccountConfig()
                {
                    EmailAddress = Account2,
                    DisplayName  = Account2Displayname,
                    DisplayIndex = 2,
                    IsConfigured = true,
                    SearchTag    = this.SearchTag
                };

                Bootstrapper.ApplicationConfiguration.Accounts.Add(accountConfig);
            }

            if (Account3Colour == Brushes.Green)
            {
                var accountConfig = new AccountConfig()
                {
                    EmailAddress = Account3,
                    DisplayName  = Account3Displayname,
                    DisplayIndex = 3,
                    IsConfigured = true,
                    SearchTag    = this.SearchTag
                };

                Bootstrapper.ApplicationConfiguration.Accounts.Add(accountConfig);
            }

            if (RunAtStartup)
            {
                Logger.Log("Adding run at startup shortcut", "Verbose");
                OCUpdateManager.RunAtStartup();
            }

            Bootstrapper.ApplicationConfiguration.SaveChanges();
            Complete = true;

            System.Windows.Forms.MessageBox.Show("Configuration Updated. Please launch application from desktop shortcut.", "Configuration Saved", (MessageBoxButtons)MessageBoxButton.OK, MessageBoxIcon.Information);

            ExecuteCancelCommand();
        }
コード例 #2
0
 public Bootstrapper()
 {
     Bootstrapper.ApplicationConfiguration = new SettingsContainer(true);
     Bootstrapper.UpdateManager            = new OCUpdateManager();
     Initialize();
 }