private void RegisterHotKey() { if (Key == Key.None) { return; } if (_isKeyRegistered) { UnregisterHotKey(); } _isKeyRegistered = HotKeyWinApi.RegisterHotKey(_handle, _id, KeyModifier, InteropKey); if (!_isKeyRegistered) { throw new ApplicationException("An unexpected Error occured! (Hotkey may already be in use)"); } }
private void UnregisterHotKey() { _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id); }