joe_pool_is
Contributor
I've found a very through example on the BackgroundWorker Class on MSDN here, but I have a question that it does not address.
I have at least three (3) different, time-consuming tasks that I'd like to use a BackgroundWorker object on: Two for database queries, and one for text validation.
Can a single BackgroundWorker object be used for all three (3) of these tasks? Some of the tasks do, on occasion, call on the other tasks.
The BackgroundWorker's DoWork method includes a sender object. Would the sender be the name of the function that I used to call the BackgroundWorker's RunWorkerAsync method?
Alternately, I could drop a separate BackgroundWorker component on the form for each of my time-consuming tasks, but this may not be necessary.
I have at least three (3) different, time-consuming tasks that I'd like to use a BackgroundWorker object on: Two for database queries, and one for text validation.
Can a single BackgroundWorker object be used for all three (3) of these tasks? Some of the tasks do, on occasion, call on the other tasks.
The BackgroundWorker's DoWork method includes a sender object. Would the sender be the name of the function that I used to call the BackgroundWorker's RunWorkerAsync method?
Alternately, I could drop a separate BackgroundWorker component on the form for each of my time-consuming tasks, but this may not be necessary.