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