コード例 #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     var settings = new Properties.Settings();
     settings.ChocolateyLibDirectory = txtInstallDirectory.Text;
     settings.Save();
     Dispose();
 }
コード例 #2
0
ファイル: MappingList.cs プロジェクト: tmzu/keymapper
		private void SaveUserSettings()
		{
			Properties.Settings userSettings = new Properties.Settings();
			userSettings.MappingListFormLocation = this.Location;
			userSettings.MappingListFormWidth = this.Width;
			userSettings.Save();
		}
コード例 #3
0
ファイル: Main.cs プロジェクト: tmzu/keymapper
		static void Main()
		{
			if (AppController.IsOnlyAppInstance() == false)
			{
				return;
			}

			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
			Application.ThreadException += ApplicationThreadException;
			AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            AppController.CreateAppDirectory();

#if DEBUG
#else
			Console.Write("Redirecting console output");
			LogProvider.RedirectConsoleOutput();
#endif

            ConfigFileProvider.ValidateUserConfigFile();

			Properties.Settings userSettings = new Properties.Settings();
			if (userSettings.UpgradeRequired)
			{
                Console.WriteLine("Upgrading settings to new version");
				userSettings.Upgrade();
				userSettings.UpgradeRequired = false;
				userSettings.Save();
			}

			AppController.Start();

			Application.Run(new KeyboardForm());

			AppController.Close();
			// Release static events or else leak.
			Application.ThreadException -= ApplicationThreadException;
			AppDomain.CurrentDomain.UnhandledException -= UnhandledExceptionHandler;

		}
コード例 #4
0
ファイル: ColourMap.cs プロジェクト: stuartd/keymapper
 private void SaveSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.ColourListFormLocation = Location;
     userSettings.ColourMapShowAllButtons = _showAllButtons;
     userSettings.Save();
 }
コード例 #5
0
ファイル: ColourEditor.cs プロジェクト: stuartd/keymapper
 private void SaveUserSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.ColourEditorLocation = Location;
     userSettings.Save();
 }
コード例 #6
0
ファイル: Keyboard.cs プロジェクト: stuartd/keymapper
        private void SaveUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings
            {
                KeyboardFormLocation = Location,
                KeyboardFormWidth = Width,
                KeyboardFormHasNumberPad = hasNumberPad,
                KeyboardFormHasMacKeyboard = isMacKeyboard,
                ColourMapFormOpen = FormsManager.IsColourMapFormOpen(),
                MappingListFormOpen = FormsManager.IsMappingListFormOpen(),
                UserHasSavedSettings = true
            };

            // userSettings.KeyboardLayout = (int)AppController.KeyboardLayout;
            userSettings.Save();
        }
コード例 #7
0
ファイル: AddEditMapping.cs プロジェクト: stuartd/keymapper
 private void SaveSettings()
 {
     Properties.Settings userSettings = new Properties.Settings();
     userSettings.EditMappingFormLocation = Location;
     userSettings.Save();
 }
コード例 #8
0
ファイル: Keyboard.cs プロジェクト: tmzu/keymapper
        void SaveUserSettings()
        {
            Properties.Settings userSettings = new Properties.Settings
                {
                    KeyboardFormLocation = this.Location,
                    KeyboardFormWidth = this.Width,
                    KeyboardFormHasNumberPad = this._hasNumberPad,
                    KeyboardFormHasMacKeyboard = this._isMacKeyboard,
                    ColourMapFormOpen = FormsManager.IsColourMapFormOpen(),
                    MappingListFormOpen = FormsManager.IsMappingListFormOpen(),
                    LastMappingsFilter = (int)MappingsManager.Filter,
                    UserHasSavedSettings = true
                };

            // userSettings.KeyboardLayout = (int)AppController.KeyboardLayout;
            userSettings.Save();
        }
コード例 #9
0
ファイル: ThisAddIn.cs プロジェクト: INGENIUSCuba/c--code
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            try
            {
                //Establezco el Hadler para revisar el Email cuando entra
                //this.Application.NewMail += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_NewMailEventHandler(ThisApplication_NewMail);
                this.Application.NewMail += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_NewMailEventHandler(ThisApplication_NewMail);

                //Si no existe la carpeta MailEmprende, la creo
                if (!ExistsCurrentFolder("MailEmprende"))
                {
                    CreateCustomFolder("MailEmprende");
                }

                //Cargo los settings
                Properties.Settings setting;
                setting = new Properties.Settings(); //Creo variable para acceder a Settings

                //Establezco la ruta a la db local correos.mdb
                string path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "correos.mdb");
                setting["DBpath"] = path;
                setting.Save();

                //Actualizo el setting de envío desde la BD
                OutlookAddInEmprende.correosDataSetTableAdapters.settingsTableAdapter taSettings = new OutlookAddInEmprende.correosDataSetTableAdapters.settingsTableAdapter();
                setting["Email_Admin"] = taSettings.GetEmailAdmin()[0].Email_Admin.ToString();
                setting.Save();

                //Seteo los valores de login por defecto si existían
                setting["Logon_User"] = setting["Default_User"]; //Declaro usuario por defecto
                setting["logged"] = setting["Default_Logged"]; //Declaro tipo de usuario logueado por defecto
                setting.Save();

            }
            catch
            {
                MessageBox.Show(ex.Message + " Se intentaba abrir el Componente OutlookAddin Emprende", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }