public BGWorker(StartFunc startFunc, CompleteFunc completeFunc) { _startFunc = startFunc; _completeFunc = completeFunc; bw = new BackgroundWorker(); bw.DoWork += DoWork; bw.RunWorkerCompleted += Complete; bw.RunWorkerAsync(); }
public BGWorker(StartFunc startFunc, CompleteFunc completeFunc) { _startFunc = startFunc; _completeFunc = completeFunc; bw = new BackgroundWorker(); bw.WorkerSupportsCancellation = true; bw.DoWork += DoWork; bw.RunWorkerCompleted += Complete; bw.RunWorkerAsync(); }