views:

55

answers:

1

Hi,

as described in the title. My backgroundworker is doing its job...finishes the first part and calls the ...Completed event handler. Can I tell here my backgroundworker to proceed with another job by doing DoWork -= OldJob DoWork += NewJob

also DoWorkCompleted -= OldJobCompleted DoWorkCompleted += NewJobCompleted

Is this possible?

+1  A: 

I haven't tried it before, but I guess it would work. Wouldn't you need to change the event handler for ProgressChanged and RunWorkerCompleted too?

I think it would be a lot simpler just to create two background workers instead. Or if the jobs are very similar you could parameterize your existing background worker to be able to do both tasks.

Mark Byers