private void btnApply_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(selectedCategory) || selectedCommand == null || selectedCommand.KeyData == tbHotkey.KeyData) { return; } selectedCommand.KeyData = tbHotkey.KeyData; HotkeySettingsManager.Update(selectedCategory, selectedCommand); UpdateCommandView(selectedCategory); }
private void btnRemove_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(selectedCategory) || selectedCommand == null || selectedCommand.KeyData == Keys.None) { return; } selectedCommand.KeyData = Keys.None; HotkeySettingsManager.Update(selectedCategory, selectedCommand); tbHotkey.SetKeydata(selectedCategory, selectedCommand); UpdateCommandView(selectedCategory); }