/// <summary> /// Fires the <see cref="onInactive"/> and <see cref="Inactive"/> events. /// </summary> private void OnInactive() { if (IsActive) { IsActive = false; onInactive?.Invoke(); Inactive?.Invoke(this, EventArgs.Empty); } }
private void Stop() { _timer.Cancel(); _timer = null; Inactive?.Invoke(this, null); }