private BackgroundWorker bw1; private BackgroundWorker bw2; private BackgroundWorker bw3; private BackgroundWorker bw4;
bw1 = new BackgroundWorker(); bw1.WorkerReportsProgress = true; bw1.DoWork += new DoWorkEventHandler(bw1_DoWork); bw1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw1_RunWorkerCompleted); bw1.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged); bw2 = new BackgroundWorker(); bw2.WorkerReportsProgress = true; bw2.DoWork += new DoWorkEventHandler(bw2_DoWork); bw2.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw2_RunWorkerCompleted); bw2.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged); bw3 = new BackgroundWorker(); bw3.WorkerReportsProgress = true; bw3.DoWork += new DoWorkEventHandler(bw3_DoWork); bw3.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw3_RunWorkerCompleted); bw3.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged); bw4 = new BackgroundWorker(); bw4.WorkerReportsProgress = true; bw4.DoWork += new DoWorkEventHandler(bw4_DoWork); bw4.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw4_RunWorkerCompleted); bw4.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
bw1.RunWorkerAsync()
bw2.RunWorkerAsync()
Parallel.Invoke(new Action(Method1),new Action(Method2),new Action(Method3),...);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)