/// <summary> /// Stops the current running hotkey thread. /// </summary> public void Stop() { if (Runner != null) { Runner.Stop(); Runner = null; } }
/// <summary> /// Starts a new thread where the hotkeys are registered and monitored. /// </summary> /// <exception cref="InvalidOperationException">Thrown if a hotkey manager is already running.</exception> public void Start() { if (Runner == null) { Runner = new HotkeyRunner(hotkeys); Runner.Start(); } else { throw new InvalidOperationException("This manager already has a running process. " + "Please stop the current runner before starting a new one."); } }