private void button2_Click(object sender, EventArgs e) { bolEmProducao = false; TaskController.Cancel(); TaskController = new CancellationTokenSource(); Token = TaskController.Token; CancelaProcesso(); this.label1.Text = "Produção parada..."; }
private void frmSupervisorio_FormClosed(object sender, FormClosedEventArgs e) { CancelaProcesso(); TaskController.Cancel(); }