private void BT_StopSim_Click(object sender, EventArgs e) { if (BGW_LifecycleDemo.WorkerSupportsCancellation == true) { // Cancel the asynchronous operation. BGW_LifecycleDemo.CancelAsync(); } }
private void BT_StartSim_Click(object sender, EventArgs e) { if (BGW_LifecycleDemo.IsBusy != true) { // Start the asynchronous operation. BGW_LifecycleDemo.RunWorkerAsync(); } }