Esempio n. 1
0
 /// <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
         ;
     }
 }
Esempio n. 2
0
 /// <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());
 }