private void RegisterHotKey() { if (Key == Key.None) { return; } if (_isKeyRegistered) { UnregisterHotKey(); } _isKeyRegistered = HotKeyWinApi.RegisterHotKey(_handle, _id, KeyModifier, InteropKey); if (!_isKeyRegistered) { throw new ApplicationException(Properties.strings.hotkeyInUse); } }
private void UnregisterHotKey() { _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id); }