void Reset() { HotKeys.Clear(); foreach (HotKeyBinding item in HotKeysMapping.Load()) { HotKeys.Add(item); } }
//TODO EXCEPTION HANDLING /// <inheritdoc /> public override void UnregisterAll() { foreach (var hotKeysValue in HotKeys.Values) { hotKeysValue.UnregisterHotKey(); } HotKeys.Clear(); }
private void btnSave_Click(object sender, RoutedEventArgs e) { #region 保存热键 HotKeys.Clear(); foreach (var child in this.yy.Children) { if (child is HotKeySettingControl) { HotKeySettingControl setting = child as HotKeySettingControl; if (setting.HotKey != null) { HotKeys.Add(setting.Command, setting.HotKey); } } } #endregion #region 类型关联 List <string> fileTypes = new List <string>(); //foreach (DataItem d in Items) //{ // if (d.IsEnabled) { fileTypes.Add(d.Name.Substring(d.Name.IndexOf('(').TrimEnd(')'))); } //} string dir = AppDomain.CurrentDomain.BaseDirectory; fileTypes.AddRange(Items.Where(item => item.IsEnabled).Select(ss => ss.Name.Substring(ss.Name.IndexOf('(') + 1).Trim(')'))); TypeRegsiter.Regsiter(dir + "\\Player.exe", dir + "Resouce\\Symbian_Anna.dll", fileTypes); // TypeRegsiter.Regsiter(fileTypes); //TODO FileRegisterSave(); #endregion this.Close(); if (SettingReloadHandler != null) { SettingReloadHandler(HotKeys); } }