/// <summary> /// Cancels the loop synchronously at the next available time /// </summary> public void CancelSync(object sender) { cancel = true; Report.General($"{GetType()} cancellation requested."); CancelationRequest?.Invoke(sender, new EventArgs()); while (thread.IsAlive) { // ReSharper disable once EmptyEmbeddedStatement ; } }
/// <summary> /// Cancels the loop asynchronously at the next available time /// </summary> public void CancelAsync(object sender) { cancel = true; Report.General($"{GetType()} cancellation requested."); CancelationRequest?.Invoke(sender, new EventArgs()); }