private bool RaiseBackroundTaskStarted(ThreadWorkerTaskBase task) { if (OnBackgroundTaskStarted != null) { ThreadWorkerProgressArgs args = new ThreadWorkerProgressArgs(task.TaskID, 1, 0, null, false, null); OnBackgroundTaskStarted(task.WorkerThread, args); } return(false); }
public TaskResultInfo(ThreadWorkerTaskBase task, ThreadWorkerProgressArgs args) { this.Task = task; this.Args = args; }
protected void RaiseBackgroundTaskFinished(ThreadWorkerTaskBase task, int total, int current, Exception error, object result) { ThreadWorkerProgressArgs args = new ThreadWorkerProgressArgs(task.TaskID, total, current, error, true, result); taskResultInfos.Enqueue(new TaskResultInfo(task, args)); }