protected void RaiseWorkerFault(TArg arg, Exception exception) { WorkerEventArgs <TArg, Exception> eventArgs = new WorkerEventArgs <TArg, Exception>(arg, exception); try { OnWorkerFault(eventArgs); } finally { WorkerFault?.Invoke(this, eventArgs); } }
protected void RaiseWorkerCanceled(TArg arg) { WorkerEventArgs <TArg> eventArgs = new WorkerEventArgs <TArg>(arg); try { OnWorkerCanceled(eventArgs); } finally { WorkerCanceled?.Invoke(this, eventArgs); } }
protected override void RaiseWorkerComplete(Task workerTask, TArg arg) { WorkerEventArgs <TArg> eventArgs = new WorkerEventArgs <TArg>(arg); try { OnWorkerComplete(eventArgs); } finally { WorkerComplete?.Invoke(this, eventArgs); } }
protected virtual void OnWorkerFault(WorkerEventArgs <TArg, Exception> args) { }
protected virtual void OnWorkerCanceled(WorkerEventArgs <TArg> args) { }
protected virtual void OnWorkerComplete(WorkerEventArgs <TArg> eventArgs) { }