BackgroundWorker - CancellationPending changing to false in RunWorkerCompleted. Why?
问题 After canceling the BackGroundWorker, in the DoWork, the CancellationPending is true but when he comes to the RunWorkerCompleted, the CancellationPending is false. I dont know what did I do wrong? static BackgroundWorker b1; static void Main(string[] args) { b1=new BackgroundWorker(); b1.DoWork += new DoWorkEventHandler(work1); b1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(completed); b1.WorkerSupportsCancellation = true; b1.RunWorkerAsync("Hellow"); Console.ReadLine(); }