/// <summary> /// Load the selected value to the saved hotkey /// and load the combo boxes with the stored sessions /// and set the selected value to the saved hotkey /// </summary> /// <param name="reloadSessions"></param> private void setHotkeys(bool reloadSessions) { Session[] sa = null; ComboBox c; if (reloadSessions) { sa = sc.getSessionList().ToArray(); } // Suspend hotkey updates suspendHotkeyUpdate = true; foreach (HotkeyController.HotKeyId hkid in comboDictionary.Keys) { comboDictionary.TryGetValue(hkid, out c); if (reloadSessions) { c.Items.AddRange(sa); } c.SelectedItem = hkc.getSessionFromHotkey(hkid); } // Resume hotkey updates suspendHotkeyUpdate = false; }
/// <summary> /// Process the hotkey event /// </summary> /// <param name="id">The hotkey that was pressed</param> private void processHotKey(int id) { // If it's the minimize hotkey switch the display state if (id == (int)HotkeyController.HotKeyId.HKID_MINIMIZE) { switchApplicationVisibility(); return; } // Otherwise figure out which session to launch Session s = hkc.getSessionFromHotkey((HotkeyController.HotKeyId)id); sessionControl_LaunchSession(this, new LaunchSessionEventArgs(s)); }