Beispiel #1
0
        private void frmProcessingStatus_LoadAsync(object sender, EventArgs e)
        {
            if (_isParentScheduledTask)
            {
                List <string> assemblyList = NugetPackageManager.LoadPackageAssemblies(_configPath, true);
                Dictionary <string, List <Type> > groupedTypes = new Dictionary <string, List <Type> >();
                var builder = AppDomainSetupManager.LoadBuilder(assemblyList, groupedTypes);
                ScriptEngineContext.Container = builder.Build();
            }

            //move engine form to bottom right and bring to front
            if (_engineSettings.ShowDebugWindow)
            {
                BringToFront();
                MoveFormToBottomRight(this);
            }

            CommandControls = new CommandControls();

            //start running
            EngineInstance = new AutomationEngineInstance(ScriptEngineContext);

            if (IsNewTaskSteppedInto)
            {
                EngineInstance.PauseScript();
                uiBtnPause.Image       = Resources.engine_resume;
                uiBtnPause.DisplayText = "Resume";
                uiBtnStepOver.Visible  = true;
                uiBtnStepInto.Visible  = true;

                ScriptEngineContext.ScriptBuilder.CurrentEngine = this;

                //toggle running flag to allow for tab selection
                ScriptEngineContext.ScriptBuilder.IsScriptRunning = false;
                ((frmScriptBuilder)ScriptEngineContext.ScriptBuilder).OpenOpenBotsFile(ScriptEngineContext.FilePath, true);
                ScriptEngineContext.ScriptBuilder.IsScriptRunning = true;
            }

            EngineInstance.ReportProgressEvent    += Engine_ReportProgress;
            EngineInstance.ScriptFinishedEvent    += Engine_ScriptFinishedEvent;
            EngineInstance.LineNumberChangedEvent += EngineInstance_LineNumberChangedEvent;
            EngineInstance.AutomationEngineContext.ScriptEngine = this;
            EngineInstance.IsServerExecution = ServerExecution;

            if (JsonData == null)
            {
                EngineInstance.ExecuteScriptAsync();
            }
            else
            {
                EngineInstance.ExecuteScriptJson();
            }
        }
Beispiel #2
0
        private void frmProcessingStatus_Load(object sender, EventArgs e)
        {
            //move engine form to bottom right and bring to front
            if (_engineSettings.ShowDebugWindow)
            {
                BringToFront();
                MoveFormToBottomRight(this);
            }

            //start running
            EngineInstance = new AutomationEngineInstance(ScriptEngineLogger);

            if (IsNewTaskSteppedInto)
            {
                EngineInstance.PauseScript();
                uiBtnPause.Image       = Properties.Resources.command_resume;
                uiBtnPause.DisplayText = "Resume";
                uiBtnStepOver.Visible  = true;
                uiBtnStepInto.Visible  = true;

                CallBackForm.CurrentEngine = this;

                //toggle running flag to allow for tab selection
                CallBackForm.IsScriptRunning = false;
                ((frmScriptBuilder)CallBackForm).OpenFile(FilePath);
                CallBackForm.IsScriptRunning = true;
            }

            EngineInstance.ReportProgressEvent    += Engine_ReportProgress;
            EngineInstance.ScriptFinishedEvent    += Engine_ScriptFinishedEvent;
            EngineInstance.LineNumberChangedEvent += EngineInstance_LineNumberChangedEvent;
            EngineInstance.TaskModel       = RemoteTask;
            EngineInstance.TasktEngineUI   = this;
            EngineInstance.ServerExecution = ServerExecution;

            LocalTCPClient.AutomationInstance = EngineInstance;

            if (JsonData == null)
            {
                EngineInstance.ExecuteScriptAsync(this, FilePath, _scriptVariableList, _scriptElementList);
            }
            else
            {
                EngineInstance.ExecuteScriptJson(JsonData);
            }
        }