internal static IAsyncOperationWithProgress<TResult, TProgress> CreateFaultedOperation<TResult, TProgress>(Exception error) { if (error == null) throw new ArgumentNullException("error"); Contract.EndContractBlock(); var asyncInfo = new TaskToAsyncOperationWithProgressAdapter<TResult, TProgress>(default(TResult)); asyncInfo.DangerousSetError(error); Debug.Assert(asyncInfo.Status == AsyncStatus.Error); return asyncInfo; }
internal static IAsyncOperationWithProgress <TResult, TProgress> CreateFaultedOperation <TResult, TProgress>(Exception error) { if (error == null) { throw new ArgumentNullException(nameof(error)); } var asyncInfo = new TaskToAsyncOperationWithProgressAdapter <TResult, TProgress>(default(TResult)); asyncInfo.DangerousSetError(error); Debug.Assert(asyncInfo.Status == AsyncStatus.Error); return(asyncInfo); }
internal static IAsyncOperationWithProgress <TResult, TProgress> CreateCompletedOperation <TResult, TProgress>(TResult synchronousResult) { var asyncInfo = new TaskToAsyncOperationWithProgressAdapter <TResult, TProgress>(synchronousResult); return(asyncInfo); }