private void btCancel_Click(object sender, System.EventArgs e)
 {
     this.wasUserInterrupted = true;
     if (_monitor != null)
     {
         _monitor.SetCancellationPending();
         btCancel.Visible     = false;
         _btInterrupt.Visible = true;
     }
     else
     {
         btCancel.Visible     = false;
         _btInterrupt.Visible = true;
         _btInterrupt_Click(sender, e);
     }
 }
Exemple #2
0
 private void EhCancelClicked(object sender, RoutedEventArgs e)
 {
     _wasCancelledByUser = true;
     if (_monitor != null)
     {
         _monitor.SetCancellationPending();
         _btCancel.Visibility    = System.Windows.Visibility.Collapsed;
         _btInterrupt.Visibility = System.Windows.Visibility.Visible;
     }
     else
     {
         _btCancel.Visibility    = System.Windows.Visibility.Collapsed;
         _btInterrupt.Visibility = System.Windows.Visibility.Visible;
         EhInterruptClicked(sender, e);
     }
 }