public void KeysConfirm() { try { var keySetting = new Models.KeySetting { ModulesKey = ModulesList.SelectedItem.KeyModulesItem.ModulesItem.ModulesKey, ModifierKeys = temp_ModifierKeys, Key = temp_Key, Type = SelectKeyType, IsNotSetKey = false }; if (temp_ModifierKeys == ModifierKeys.None && temp_Key == Key.None) { keySetting.Type = Enums.KeyType.Normal; keySetting.IsNotSetKey = true; } Modules.KeysModules.Current.SetKey(keySetting); GoBack(); } catch (NotImplementedException ex) { MessageBoxDialog.Show(ex.Message); } catch (Exception) { } }
public void SetKey(Models.KeySetting keysetting) { var keyModulesItem = GetKeyModulesItem(keysetting); if (keyModulesItem != null) { Setting.AddOrUpdate(keysetting); Generic.HotKeyHelper.Current.Set(keyModulesItem); MainWindowModules.Current.SetKeys(keyModulesItem); } OnKeysPublicModulesChange(); }
public void AddOrUpdate(Models.KeySetting keysetting) { var key = keysetting.ModulesKey; if (this.KeySettingList.ContainsKey(key)) { this.KeySettingList[key] = keysetting; } else { this.KeySettingList.Add(key, keysetting); } }
public Models.KeyModulesItem GetKeyModulesItem(Models.KeySetting keySetting) { var key = keySetting.ModulesKey; var modulesItem = this.CurrentPublicModules.FirstOrDefault(item => item.ModulesKey == key); if (modulesItem == null) { return(null); } return(new Models.KeyModulesItem { ModulesItem = modulesItem, KeySetting = keySetting }); }
public bool Remove(Models.KeySetting keysetting) { return(this.KeySettingList.Remove(keysetting.ModulesKey)); }