Canceling BackgroundWorker within the Thread

Posted by Mike Wills on Stack Overflow See other posts from Stack Overflow or by Mike Wills
Published on 2010-03-16T13:47:02Z Indexed on 2010/03/17 9:51 UTC
Read the original article Hit count: 319

I have a longer running multi-step process using BackgroundWorker and C#. I need to be sure that each step is completed successfully before moving on to the next step. I have seen many references to letting the BackgroundWorker catch errors and canceling from clicking on a Cancel button, but I want to check for an error myself and then gracefully end the process. Do I treat it just like someone clicked the cancel button, or is there another way?

© Stack Overflow or respective owner

Related posts about backgroundworker

Related posts about c#