public override void RunCommand(object sender, ScriptAction parentCommand)
        {
            LoopNumberOfTimesCommand loopCommand = (LoopNumberOfTimesCommand)parentCommand.ScriptCommand;
            var engine = (IAutomationEngineInstance)sender;

            int loopTimes;

            var loopParameter = loopCommand.v_LoopParameter.ConvertUserVariableToString(engine);

            loopTimes = int.Parse(loopParameter);

            int.TryParse(v_LoopStart.ConvertUserVariableToString(engine), out int startIndex);

            for (int i = startIndex; i < loopTimes; i++)
            {
                engine.ReportProgress("Starting Loop Number " + (i + 1) + "/" + loopTimes + " From Line " + loopCommand.LineNumber);

                foreach (var cmd in parentCommand.AdditionalScriptCommands)
                {
                    if (engine.IsCancellationPending)
                    {
                        return;
                    }

                    engine.ExecuteCommand(cmd);

                    if (engine.CurrentLoopCancelled)
                    {
                        engine.ReportProgress("Exiting Loop From Line " + loopCommand.LineNumber);
                        engine.CurrentLoopCancelled = false;
                        return;
                    }

                    if (engine.CurrentLoopContinuing)
                    {
                        engine.ReportProgress("Continuing Next Loop From Line " + loopCommand.LineNumber);
                        engine.CurrentLoopContinuing = false;
                        break;
                    }
                }
                engine.ReportProgress("Finished Loop From Line " + loopCommand.LineNumber);
            }
        }
        public async override Tasks.Task RunCommand(object sender, ScriptAction parentCommand)
        {
            LoopNumberOfTimesCommand loopCommand = (LoopNumberOfTimesCommand)parentCommand.ScriptCommand;
            var engine    = (IAutomationEngineInstance)sender;
            int loopTimes = (int)await loopCommand.v_LoopParameter.EvaluateCode(engine);

            for (int i = 0; i < loopTimes; i++)
            {
                engine.ReportProgress("Starting Loop Number " + (i + 1) + "/" + loopTimes + " From Line " + loopCommand.LineNumber);

                foreach (var cmd in parentCommand.AdditionalScriptCommands)
                {
                    if (engine.IsCancellationPending)
                    {
                        return;
                    }

                    await engine.ExecuteCommand(cmd);

                    if (engine.CurrentLoopCancelled)
                    {
                        engine.ReportProgress("Exiting Loop From Line " + loopCommand.LineNumber);
                        engine.CurrentLoopCancelled = false;
                        return;
                    }

                    if (engine.CurrentLoopContinuing)
                    {
                        engine.ReportProgress("Continuing Next Loop From Line " + loopCommand.LineNumber);
                        engine.CurrentLoopContinuing = false;
                        break;
                    }
                }
                engine.ReportProgress("Finished Loop From Line " + loopCommand.LineNumber);
            }
        }