コード例 #1
0
        private Task ExecuteStepInternal(SetupStepInvocation invocation, ObjectValidationCallback validationCallback)
        {
            AbstractSetupStep step = this._setupSteps.Value[invocation.SetupStepNumber];

            object data = DeserializeData(invocation, validationCallback, step.DataType);

            return(step.Execute(data));
        }
コード例 #2
0
        public async Task <SetupStepDescriptor> DetermineCurrentStep()
        {
            AbstractSetupStep initialSetupStep    = null;
            const int         firstRealSetupIndex = 2;

            for (int i = 0; i < this._setupSteps.Value.Length; i++)
            {
                AbstractSetupStep current = this._setupSteps.Value[i];

                bool hasBeenExecuted = await current.HasBeenExecuted();

                if (hasBeenExecuted)
                {
                    continue;
                }

                if (i < firstRealSetupIndex)
                {
                    initialSetupStep = initialSetupStep ?? current;
                }
                else
                {
                    this._logger.LogInformation("Determine current step: Step #{0} ('{1}') has been determined that is has not been executed", i, current.Name);

                    if (i > 1 && initialSetupStep != null && !(current is DoneSetupStep))
                    {
                        return(this.CreateDescriptor(Array.IndexOf(this._setupSteps.Value, initialSetupStep)));
                    }

                    return(this.CreateDescriptor(i));
                }

                this._logger.LogInformation("Determine current step: Step #{0} ('{1}') has been determined that is has executed", i, current.Name);
            }

            return(this.CreateDescriptor(this._setupSteps.Value.Length - 1));
        }