Ok, so the WaitOne is blocking the RunWorkerCompleted from triggering. Have to Set the ManualResetEvent at the end of DoWork.
var bgw = new BackgroundWorker();
var mre = new ManualResetEvent(false);
bgw.DoWork += (s, a) => { Thread.Sleep(1000); mre.Set(); };
bgw.RunWorkerCompleted += (s, a) => { };
bgw.RunWorkerAsync();
mre.WaitOne();
0
18 Jun 2015 06:13
u/periander
in v/programming
Ok, so the WaitOne is blocking the RunWorkerCompleted from triggering. Have to Set the ManualResetEvent at the end of DoWork.