예제 #1
0
 private void ResetTask()
 {
     _taskWorkItem = null;
     _task = null;
 }
예제 #2
0
 public void StartTask(Action task)
 {
     if (_taskWorkItem != null) throw new InvalidOperationException("Cannot change background task while it's running");
     _task = task;
     _taskWorkItem = AbortableThreadPool.QueueUserWorkItem(RunTask, new TaskStatus());
 }