コード例 #1
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     WindowsHelper.Hotkey Validator = GetHotkeyFromControls();
     if (Validator.Modifiers == WindowsHelper.KeyModifier.None || Validator.Key == Keys.None)
     {
         this.existingHotkey = null;
         this.Hotkey         = null;
         this.Close();
         return;
     }
     if (!Validator.Validate())
     {
         MessageBox.Show("One or more settings is invalid", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (!isNew)
     {
         this.existingHotkey = GetHotkeyFromControls();
         this.Hotkey         = GetHotkeyFromControls();
         this.Close();
     }
     else
     {
         this.Hotkey = GetHotkeyFromControls();
         this.Close();
     }
 }
コード例 #2
0
 public frm_HotkeyEditor()
 {
     InitializeComponent();
     isNew = true;
     populateCharacterCombobox();
     this.Hotkey = new WindowsHelper.Hotkey();
     combo_Character.DataSource = availableKeys;
     UpdateControls();
 }
コード例 #3
0
        public frm_HotkeyEditor(WindowsHelper.Hotkey Hotkey)
        {
            InitializeComponent();
            isNew = false;
            populateCharacterCombobox();
            this.existingHotkey = Hotkey;
            this.Hotkey         = Hotkey.Clone();

            combo_Character.DataSource = availableKeys;
            UpdateControls();
        }