public void CanConstruct()
        {
            var ex   = new Exception("test exception");
            var args = new ProcessCancelledEventArgs(ex);

            Assert.True(args.CancelCause == ex);

            args = ProcessCancelledEventArgs.Empty;
            Assert.Null(args.CancelCause);
        }
Пример #2
0
 /// <summary>
 /// Handles the ping module cancelled event. This turns off the run
 /// timer and animation and notifies the user that the process was
 /// terminated due to force from the user or due to an error.
 /// </summary>
 /// <param name="sender">
 /// The object sending the event call.
 /// </param>
 /// <param name="e">
 /// The event arguments.
 /// </param>
 private void Pm_ProcessCancelled(object sender, ProcessCancelledEventArgs e)
 {
     this.SafeToggleStatusAnim(false);
     this.SafeUpdateStatus("Cancelled");
     this.SafeToggleToolbarButton(this.toolStripButtonCancel, false);
     this.SafeToggleToolbarButton(this.toolStripButtonExec, true);
     this.SafeToggleTimer(false);
     if (e.CancelCause != null)
     {
         this.SafeWriteConsole("ERROR: " + e.CancelCause.Message, true);
     }
 }