public void RegisterHotKey() { if (Key == Keys.None) { return; } if (isKeyRegistered) { UnregisterHotKey(); } isKeyRegistered = HotkeyWinApi.RegisterHotKey(handle, id, KeyModifier, Key); if (!isKeyRegistered) { throw new HotkeyAlreadyInUseException(); } }
public void UnregisterHotKey() { isKeyRegistered = !HotkeyWinApi.UnregisterHotKey(handle, id); }