private void BTN_Exit_Click(object sender, EventArgs e) { WorkerBarber.CancelAsync(); WorkerQueue.CancelAsync(); BTN_Start.Enabled = true; BTN_Exit.Enabled = false; BTN_NewClient.Enabled = false; }
private void WorkerQueue_DoWork(object sender, DoWorkEventArgs e) { queue(); WorkerQueue.CancelAsync(); if (WorkerQueue.CancellationPending == true) { e.Cancel = true; return; } }