internal static IAsyncActionWithProgress<TProgress> CreateFaultedAction<TProgress>(Exception error) { if (error == null) throw new ArgumentNullException("error"); Contract.EndContractBlock(); var asyncInfo = new TaskToAsyncActionWithProgressAdapter<TProgress>(isCanceled: false); asyncInfo.DangerousSetError(error); Debug.Assert(asyncInfo.Status == AsyncStatus.Error); return asyncInfo; }
internal static IAsyncActionWithProgress <TProgress> CreateFaultedAction <TProgress>(Exception error) { if (error == null) { throw new ArgumentNullException(nameof(error)); } var asyncInfo = new TaskToAsyncActionWithProgressAdapter <TProgress>(isCanceled: false); asyncInfo.DangerousSetError(error); Debug.Assert(asyncInfo.Status == AsyncStatus.Error); return(asyncInfo); }
internal static IAsyncActionWithProgress <TProgress> CreateCompletedAction <TProgress>() { var asyncInfo = new TaskToAsyncActionWithProgressAdapter <TProgress>(isCanceled: false); return(asyncInfo); }