Example #1
0
        /// <summary>
        /// This method will clear the hotkey if the delete key
        /// is pressed in the combo box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBox_KeyUp(object sender, KeyEventArgs e)
        {
            ComboBox c = (ComboBox)sender;

            HotkeyController.HotKeyId hkid = (HotkeyController.HotKeyId)c.Tag;
            if (e.KeyCode == Keys.Delete)
            {
                c.SelectedItem = null;
                hkc.saveSessionnameToHotkey(parentWindow, hkid, null);
            }
        }
Example #2
0
 /// <summary>
 /// Event handler for the okButton Click event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void okButton_Click(object sender, EventArgs e)
 {
     foreach (CheckBox c in checkboxDictionary.Values)
     {
         if (c.Checked == false)
         {
             TextBox t = null;
             HotkeyController.HotKeyId hkid = (HotkeyController.HotKeyId)c.Tag;
             textboxDictionary.TryGetValue(hkid, out t);
             if (t != null)
             {
                 t.Text = hkc.getHotKeyFromId(hkid);
             }
         }
     }
     this.Hide();
     Properties.Settings.Default.Save();
 }
Example #3
0
        private void comboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Do nothing if we have suspended updates
            if (suspendHotkeyUpdate == true)
            {
                return;
            }

            ComboBox c = (ComboBox)sender;
            Session  s = (Session)c.SelectedItem;

            HotkeyController.HotKeyId hkid = (HotkeyController.HotKeyId)c.Tag;

            if (s == null ||
                Properties.Settings.Default.HotkeyFavouriteEnabled == false ||
                hkc.isSessionHotkeyEnabled(hkid) == false)
            {
                return;
            }

            hkc.saveSessionnameToHotkey(parentWindow, hkid, s);
        }