public void Dispose() { WmiProcessWatcher.Stop(); if (_hooks != null) { _hooks.Dispose(); _hooks = null; } }
public void EnableKeyboardHook(KeyboardShortcut shortcut) { if (shortcut.Enabled) { if (_hooks != null) _hooks.Dispose(); _hooks = KeyboardHook.Hook(shortcut, HandleShortcut); } else if (_hooks != null) { _hooks.Dispose(); _hooks = null; } }