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();
            }
        }
Esempio n. 2
0
        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"); }
        }