BackgroundWorker多线程任务控件
方法:
(1) worker.RunWorkerAsync(),触发DoWork事件
(2) worker.ReportProgress(),触发ProgressChanged事件,可传Object、EventArg参数
(3) worker.CancelAsync(),取消线程执行
(4) worker.Dispose(),析构资源
(5) worker.RunWorkerAsync(),异步运行
事件:
(1) worker.DoWork += / -= someEvent
(2) worker.ProgressChanged += / -= someEvent
(3) worker.RunWorkerCompleted += / -= someEvent,运行结束后自动触发
属性:
(1) worker.IsBusy,运行状态,只读
(2) worker.WorkerSupportsCancellation,是否已经调用worker.CancelAsync()
后续再补充