Dispose() public méthode

public Dispose ( ) : void
Résultat void
Exemple #1
0
 public void CleanUp()
 {
     if (kb_shortcut != null)
     {
         kb_shortcut.Dispose();
     }
 }
Exemple #2
0
        private void update_shortcut_key_quick()
        {
            HotKeyboardHook.ModifierKeys m_keys = 0;
            if (FOptions.shortcutShiftQuick)
            {
                m_keys |= HotKeyboardHook.ModifierKeys.Shift;
            }
            if (FOptions.shortcutAltQuick)
            {
                m_keys |= HotKeyboardHook.ModifierKeys.Alt;
            }
            if (FOptions.shortcutCntrlQuick)
            {
                m_keys |= HotKeyboardHook.ModifierKeys.Control;
            }
            if (FOptions.shortcutWinQuick)
            {
                m_keys |= HotKeyboardHook.ModifierKeys.Win;
            }
            if (kb_shortcut_quick != null && (shortcut_last_mod_quick != m_keys || shortcut_last_key_quick != FOptions.shortcutKeyQuick))
            {
                kb_shortcut_quick.Dispose();
                kb_shortcut_quick = null;
            }
            if (kb_shortcut_quick == null && !string.IsNullOrEmpty(FOptions.shortcutKeyQuick) && m_keys != 0)
            {
                kb_shortcut_quick             = new HotKeyboardHook();
                kb_shortcut_quick.KeyPressed += handle_keyboard_shortcut_quick;

                char key = FOptions.shortcutKeyQuick[0];
                try{
                    kb_shortcut_quick.RegisterHotKey(m_keys, (Keys)key);
                }catch (Exception e)
                {
                    MessageBox.Show("KPFloatingPanel: Unable to register QuickPass hotkey due to: " + e.Message);
                }
                shortcut_last_key_quick = FOptions.shortcutKeyQuick;
                shortcut_last_mod_quick = m_keys;
            }
        }