private void cancel_Click(object sender, EventArgs e) { if (FindServicesWorker.IsBusy) { FindServicesWorker.CancelAsync(); } //CleanUp(); }
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(); } }