Exemplo n.º 1
0
 public SettingsForm(Settings settings)
 {
     this.settings = settings;
     currentTextBox = null;
     kbdHook = new KeyboardHook();
     kbdHook.KeyboardEvent += kbdHook_KeyboardEvent;
     InitializeComponent();
     InitializeValues();
 }
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
        public SettingsForm(Settings settings, Switcher engine)
        {
            this.settings = settings;
            this.engine = engine;
            engine.Error += OnEngineError;

            InitializeComponent();
            InitializeTrayIcon();
            InitializeHotkeyBoxes();

            UpdateUi();
        }
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;
 }