示例#1
0
        internal void Run(IAsyncAction action, CoreDispatcher uiDispatcher)
        {
            bool          cont       = true;
            AppTaskResult?lastResult = null;

            while (cont)
            {
                var    task = TaskStack.Pop();
                object data;
                bool   success = task(Parameter, action, lastResult, out data);
                lastResult = new AppTaskResult(success, data, lastResult);
                cont       = (SuccessFallbackLimit == -1 || SuccessFallbackLimit > CurrentLevel) && TaskStack.Count > 0;
                CurrentLevel++;
            }
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            if (action.Status != AsyncStatus.Canceled)
            {
                uiDispatcher.RunAsync(CoreDispatcherPriority.High, () => { CompletedCallback(lastResult.Value); });
            }
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
        }
示例#2
0
        internal void Run(IAsyncAction action, CoreDispatcher uiDispatcher)
        {
            bool cont = true;
            AppTaskResult? lastResult = null;
            while (cont)
            {
                var task = TaskStack.Pop();
                object data;
                bool success = task(Parameter, action, lastResult, out data);
                lastResult = new AppTaskResult(success, data, lastResult);
                cont = (SuccessFallbackLimit == -1 || SuccessFallbackLimit > CurrentLevel) && TaskStack.Count > 0;
                CurrentLevel++;
            }
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            if (action.Status != AsyncStatus.Canceled)
                uiDispatcher.RunAsync(CoreDispatcherPriority.High, () => { CompletedCallback(lastResult.Value); });
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
        }
示例#3
0
 public AppTaskResult(bool success, object data, AppTaskResult? previousResult)
 {
     Success = success;
     Data = data;
     PreviousResult = previousResult;
 }