Пример #1
0
        public void RegisterHotKeys()
        {
            try
            {
                KeysConverter kc = new KeysConverter();

                if (this.closeLastHotKey == null)
                {
                    this.closeLastKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseLast);
                    this.closeLastHotKey   = new HotKeyManager(this.wpr.Handle, this.closeLastKeyCombo);
                    this.closeLastHotKey.Register();
                }

                if (this.closeAllHotKey == null)
                {
                    this.closeAllKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseAll);
                    this.closeAllHotKey   = new HotKeyManager(this.wpr.Handle, this.closeAllKeyCombo);
                    this.closeAllHotKey.Register();
                }
            }
            catch
            {
            }
        }
Пример #2
0
 public void UnregisterHotKeys()
 {
     if (this.closeLastHotKey != null)
     {
         this.closeLastHotKey.Dispose();
         this.closeLastHotKey = null;
     }
     if (this.closeAllHotKey != null)
     {
         this.closeAllHotKey.Dispose();
         this.closeAllHotKey = null;
     }
 }
Пример #3
0
        public void RegisterHotKeys()
        {
            try
            {
                KeysConverter kc = new KeysConverter();

                if (this.closeLastHotKey == null)
                {
                    this.closeLastKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseLast);
                    this.closeLastHotKey = new HotKeyManager(this.wpr.Handle, this.closeLastKeyCombo);
                    this.closeLastHotKey.Register();
                }

                if (this.closeAllHotKey == null)
                {
                    this.closeAllKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseAll);
                    this.closeAllHotKey = new HotKeyManager(this.wpr.Handle, this.closeAllKeyCombo);
                    this.closeAllHotKey.Register();
                }
            }
            catch
            {
            }
        }