예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        internal static IAsyncActionWithProgress <TProgress> CreateCompletedAction <TProgress>()
        {
            var asyncInfo = new TaskToAsyncActionWithProgressAdapter <TProgress>(isCanceled: false);

            return(asyncInfo);
        }