Exemplo n.º 1
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 (Exception ex) {
                ex.Show();
            }
        }
Exemplo 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"); }
        }