i am using the background worker to do an expensive operation:
backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
backgroundWorker1.RunWorkerAsync(inputs);
At the end i have this:
void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
Messagebox.Show("Done with expensive operation 1"};
}
I now have another expensive operation. Can i reuse this same background worker. I now want new callbacks as i dont want switch statements on the ProgressChanged and DoWork Callbacks to determine if i am doing operation 1 or 2.
Is it just simpler to use 2 seperate background worker classes