private void HandleFailedWork(IWork workToBeProcessed, string message) { lock (this.queueLocker) { this.failed.Add(workToBeProcessed); var args = new WorkFailedProcessingEventArgs(workToBeProcessed, message); this.OnWorkFailed(args); } }
/// <summary> /// Fires the <see cref="WorkFailed"/> events if any are registered. /// </summary> /// /// <param name="e"> /// The arguments for the event. /// </param> private void OnWorkFailed(WorkFailedProcessingEventArgs e) { // This is done to avoid a threading issue. var failedEvent = this.WorkFailed; if (failedEvent != null) { this.WorkFailed(this, e); } }
void OnWorkFailed(object sender, WorkFailedProcessingEventArgs e) { this.Called = true; }