/// <summary> /// Data sources can use this to indicate an executionDetails was canceled. /// </summary> /// <param name="executionDetails">The executionDetails.</param> /// <param name="startTime">The start time.</param> /// <param name="endTime">The end time.</param> /// <param name="state">User defined state, usually used for logging.</param> /// <exception cref="ArgumentNullException">executionDetails - executionDetails is null.</exception> /// <remarks>This is not used for timeouts.</remarks> protected void OnExecutionCanceled(ExecutionToken executionDetails, DateTimeOffset startTime, DateTimeOffset endTime, object?state) { if (executionDetails == null) { throw new ArgumentNullException(nameof(executionDetails), $"{nameof(executionDetails)} is null."); } ExecutionCanceled?.Invoke(this, new ExecutionEventArgs(executionDetails, startTime, endTime, state)); if (!SuppressGlobalEvents) { GlobalExecutionCanceled?.Invoke(this, new ExecutionEventArgs(executionDetails, startTime, endTime, state)); } }
public void OnExecutionCanceled(ExecutionEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e), $"{nameof(e)} is null."); } ExecutionCanceled?.Invoke(this, e); if (!SuppressGlobalEvents && GlobalExecutionCanceled != null) { GlobalExecutionCanceled(this, e); } }