protected virtual void Dispose(bool disposing) { if (!IsDisposed) { _globalKeyboardHook.Dispose(); _winEvent.Dispose(); IsDisposed = true; } }
private void saveHotkeys() { settings.EnableHotkeys = checkBoxEnableHotkeys.Checked; settings.HandleHotkeys = checkBoxHandleHotkeys.Checked; foreach (GadgetHotkey hotkey in hotkeys) { hotkey.Save(); } keyboardHook.Dispose(); }
private void saveHotkeys() { settings.HotkeysEnable = cbxHotkeysEnable.Checked; settings.HotkeysHandle = cbxHotkeysHandle.Checked; foreach (GadgetHotkey hotkey in hotkeys) { hotkey.Save(); } keyboardHook.Dispose(); }
public new void Dispose() { //Dispose of the keyboard hook _globalKeyboardHook.Dispose(); //Stop the screen grab timer. _pixelCheck.Stop(); _pixelCheck.Dispose(); //Normal Dispose. Dispose(true); GC.SuppressFinalize(this); }
private void NotesForm_FormClosing(object sender, FormClosingEventArgs e) { tmMetronom.Stop(); tmSoundPlayer.Stop(); timerAutoStep.Stop(); if (_globalKeyboardHook != null) { _globalKeyboardHook.KeyboardPressed -= _globalKeyboardHook_KeyboardP; _globalKeyboardHook?.Dispose(); } }
protected override void Dispose(bool disposing) { if (disposing) { hook.Dispose(); hook = null; _keyboardHookOnKeyDown = null; _keyboardhookOnKeyUp = null; } base.Dispose(disposing); }
public void MultiHook() { IntPtr wParam = new IntPtr(32); IntPtr lParam = new IntPtr(0); this.isEventFired = false; GlobalKeyboardHook ghk = new GlobalKeyboardHook(); using (GlobalKeyboardHook tbc = new GlobalKeyboardHook()) { tbc.KeyboardPressed += testMethod; Assert.NotNull(tbc); } Assert.NotNull(ghk); ghk.Dispose(); }
public void Dispose() { _globalKeyboardHook?.Dispose(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) => _globalKeyboardHook?.Dispose();