void SetButton_Click(object sender, EventArgs e) { _listener?.Dispose(); _listener = new HotKeyListener(_modifier, _key, Handle, HandleShortcut); SetButtonColor(); }
void ToggleShow(object sender, EventArgs e) { _listener?.Dispose(); if (ShowInTaskbar) { Hide(); ShowInTaskbar = false; } else { Show(); ShowInTaskbar = true; } _listener = new HotKeyListener(_modifier, _key, Handle, HandleShortcut); }