void OnHotkeyChanged(object sender, EventArgs e) { if (HotkeyControl.CurrentHotkeyAvailable) { SetHotkey(HotkeyControl.CurrentHotkey, delegate { if (!Application.Current.MainWindow.IsVisible) { _api.ShowApp(); } else { _api.HideApp(); } }); RemoveHotkey(_settings.Hotkey); _settings.Hotkey = HotkeyControl.CurrentHotkey.ToString(); } }
void ctlHotkey_OnHotkeyChanged(object sender, EventArgs e) { if (ctlHotkey.CurrentHotkeyAvailable) { SetHotkey(ctlHotkey.CurrentHotkey, delegate { if (!System.Windows.Application.Current.MainWindow.IsVisible) { _api.ShowApp(); } else { _api.HideApp(); } }); RemoveHotkey(_settings.Hotkey); _settings.Hotkey = ctlHotkey.CurrentHotkey.ToString(); } }
void ctlHotkey_OnHotkeyChanged(object sender, EventArgs e) { if (ctlHotkey.CurrentHotkeyAvailable) { SetHotkey(ctlHotkey.CurrentHotkey, delegate { if (!App.Window.IsVisible) { _api.ShowApp(); } else { _api.HideApp(); } }); RemoveHotkey(UserSettingStorage.Instance.Hotkey); UserSettingStorage.Instance.Hotkey = ctlHotkey.CurrentHotkey.ToString(); UserSettingStorage.Instance.Save(); } }