public void ReloadHotkeys() { try { KeyboardHookManager.UnregisterAll(); foreach (var ah in ActiveHotkeys.Values.Where(ah => ah.Hotkey != null && ah.Action != null && ah.Hotkey.Key != Key.None)) { RegisterHotkey(ah.Hotkey, ah.Action); } } catch (Exception ex) { ex.Show(); } }
public void ReloadHotkeys() { try { KeyboardHookManager.UnregisterAll(); foreach (var ah in ActiveHotkeys.Values.Where(ah => ah.Hotkey != null && ah.Action != null && ah.Hotkey.Key != Key.None)) { RegisterHotkey(ah.Hotkey, ah.Action); } } catch (HotkeyAlreadyRegisteredException) { MessageBox.Show(@"Can not register duplicate hotkeys.", @"Warning"); } catch { MessageBox.Show(@"Could not reload hotkeys.", @"Warning"); } }