Ejemplo n.º 1
0
 private void cancel_Click(object sender, EventArgs e)
 {
     if (FindServicesWorker.IsBusy)
     {
         FindServicesWorker.CancelAsync();
     }
     //CleanUp();
 }
Ejemplo n.º 2
0
 private void ServiceSelectionDialog_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.FindServicesWorker.RunWorkerCompleted -= this.FindServicesWorker_RunWorkerCompleted;
     this.FindServicesWorker.ProgressChanged    -= this.FindServicesWorker_ProgressChanged;
     if (FindServicesWorker.IsBusy)
     {
         FindServicesWorker.CancelAsync();
     }
 }
Ejemplo n.º 3
0
 // use from _DoWork like so:
 // if (!ReportProgressIfNotCancelled(...)) { return; }
 private Boolean ReportProgressIfNotCancelled(int progress, Object message)
 {
     if (FindServicesWorker.CancellationPending)
     {
         return(false);
     }
     else
     {
         FindServicesWorker.ReportProgress(progress, message);
         return(true);
     }
 }
Ejemplo n.º 4
0
 internal void FindServices()
 {
     FindServicesWorker.RunWorkerAsync();
     timer.Start();
 }