Пример #1
0
        /// <summary>
        /// Execute actions configured in the context.
        /// </summary>
        /// <returns><c>Task</c> that completes when all the actions in the context finish.</returns>
        public async Task ExecuteActions()
        {
            _statusNode.Value = "COMPLETE";
            while (_pendingActions.Count > 0)
            {
                IActionWrapper nextAction = _pendingActions.First.Value;
                _pendingActions.RemoveFirst();

                await nextAction.Execute(_serviceProvider, this);

                LogAction(nextAction);

                if (nextAction.ActionError)
                {
                    _errorMessageNode.Value = nextAction.ErrorMessage;
                    _statusNode.Value       = "ERROR";
                    break;
                }
            }
        }