Exemple #1
0
 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)
     {
     }
 }
Exemple #2
0
        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();
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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
            });
        }
Exemple #5
0
 public bool Remove(Models.KeySetting keysetting)
 {
     return(this.KeySettingList.Remove(keysetting.ModulesKey));
 }
 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)
     {
     }
 }