//events and methods #region Form Events/Methods public frmScriptEngine(string pathToFile, string projectPath, frmScriptBuilder builderForm, Logger engineLogger, List <ScriptVariable> variables = null, List <ScriptElement> elements = null, Dictionary <string, object> appInstances = null, bool blnCloseWhenDone = false, bool isDebugMode = false) { InitializeComponent(); ScriptEngineLogger = engineLogger; IsDebugMode = isDebugMode; if (variables != null) { _scriptVariableList = variables; } if (elements != null) { _scriptElementList = elements; } if (appInstances != null) { _scriptAppInstanceDict = appInstances; } CloseWhenDone = blnCloseWhenDone; //set callback form CallBackForm = builderForm; //set file FilePath = pathToFile; ProjectPath = projectPath; //get engine settings _engineSettings = new ApplicationSettings().GetOrCreateApplicationSettings().EngineSettings; if (isDebugMode) { _engineSettings.ShowDebugWindow = true; _engineSettings.ShowAdvancedDebugOutput = true; } //determine whether to show listbox or not _advancedDebug = _engineSettings.ShowAdvancedDebugOutput; //if listbox should be shown if (_advancedDebug) { lstSteppingCommands.Show(); lblMainLogo.Show(); pbBotIcon.Hide(); lblAction.Hide(); } else { lstSteppingCommands.Hide(); lblMainLogo.Hide(); pbBotIcon.Show(); lblAction.Show(); } //apply debug window setting if (!_engineSettings.ShowDebugWindow) { Visible = false; Opacity = 0; } //add hooks for hot key cancellation GlobalHook.HookStopped += new EventHandler(OnHookStopped); GlobalHook.StartEngineCancellationHook(_engineSettings.CancellationKey); }
public frmSettings(frmScriptBuilder sender) { scriptBuilderForm = sender; InitializeComponent(); }