public void Invoke(IOperationResult result) { Should.NotBeNull(result, nameof(result)); if (_asyncOperation == null) { _callback?.Invoke(result); } else { _asyncOperation.SetResult(result, true); } }
public void Invoke(IOperationResult result) { Should.NotBeNull(result, "result"); if (_asyncOperation == null) { if (_callback != null) { _callback.Invoke(result); } } else { _asyncOperation.SetResult(result, true); } }
private IAsyncOperationInternal AddContinuation(IAsyncOperationInternal asyncOperation) { if (!IsCompleted) { lock (_continuations) { if (!IsCompleted) { _continuations.Add(asyncOperation); return(asyncOperation); } } } asyncOperation.SetResult(_result, true); return(asyncOperation); }