Exemplo n.º 1
0
 private void InitSettings()
 {
     settings = new Settings();
     settings.Reload();
     if (settings.SwitchHotkey.KeyData == Keys.None)
     {
         settings.SwitchHotkey = new KeyboardEventArgs(Keys.Pause, false);
     }
     SaveSettings();
 }
Exemplo n.º 2
0
 private void InitSettings()
 {
     settings = new Settings();
     settings.Reload();
     if (settings.SwitchHotkey.KeyData == Keys.None)
     {
         settings.SwitchHotkey = new KeyboardEventArgs(Keys.Pause, false);
     }
     SaveSettings();
 }
Exemplo n.º 3
0
        private void OnSettings(object sender, EventArgs e)
        {
            engine.Stop();
            var settingsForm = new SettingsForm(settings);

            settingsForm.FormClosed += (a, b) => engine.Start();
            var result = settingsForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                SaveSettings();
            }
            else
            {
                settings.Reload();
            }
        }
Exemplo n.º 4
0
        public static Settings Init()
        {
            var settings = new Settings();

            settings.Reload();
            if (settings.SwitchHotkey.KeyData == Keys.None)
            {
                settings.SwitchHotkey = new KeyboardEventArgs(Keys.Pause, false);
            }
            if (settings.ConvertSelectionHotkey.KeyData == Keys.None)
            {
                settings.ConvertSelectionHotkey = new KeyboardEventArgs(Keys.Pause | Keys.Shift, false);
            }
            if (settings.ShowTrayIcon == null)
            {
                settings.ShowTrayIcon = true;
            }
            if (settings.SwitchDelay < 1)
            {
                settings.SwitchDelay = 20;
            }
            settings.Save();
            return(settings);
        }
Exemplo n.º 5
0
 void ResetSettings()
 {
     settings.Reload();
 }
Exemplo n.º 6
0
 public static Settings Init()
 {
     var settings = new Settings();
     settings.Reload();
     if (settings.SwitchHotkey.KeyData == Keys.None)
     {
         settings.SwitchHotkey = new KeyboardEventArgs(Keys.Pause, false);
     }
     if (settings.ConvertSelectionHotkey.KeyData == Keys.None)
     {
         settings.ConvertSelectionHotkey = new KeyboardEventArgs(Keys.Pause | Keys.Shift, false);
     }
     if (settings.ShowTrayIcon == null)
     {
         settings.ShowTrayIcon = true;
     }
     if (settings.SwitchDelay < 1)
     {
         settings.SwitchDelay = 20;
     }
     settings.Save();
     return settings;
 }