示例#1
0
 protected void Completed(bool isAborted, bool closeDialog, string message)
 {
     if (_stopped)
     {
         return;
     }
     _stopped = true;
     OnStopped();
     // pending UI tasks have to be processed before the dialog is closed.
     DoUIEvents();
     if (isAborted)
     {
         _site.Cancel(message);
     }
     else
     {
         if (message != null)
         {
             _site.MainWindow.Information(message);
         }
         _site.Complete();
     }
     if (closeDialog)
     {
         _dialog.AsyncClose();
     }
     else
     {
         _dialog.AsyncReset();
     }
     Dispose();
 }
 /// <summary>
 /// Close
 /// </summary>
 public void Close()
 {
     lock (_signal) {
         if (!_closed)
         {
             _closed = true;
             Monitor.PulseAll(_signal);
             _site.Complete();
         }
     }
 }