public VisualEnvironmentCompiler(InvokeDegegate beginInvoke, SetFlagDelegate setCompilingButtonsEnabled, SetFlagDelegate setCompilingDebugEnabled, SetTextDelegate setStateText, SetTextDelegate addTextToCompilerMessages, ToolStripMenuItem pluginsMenuItem, ToolStrip pluginsToolStrip, ExecuteSourceLocationActionDelegate ExecuteSLAction, ExecuteVisualEnvironmentCompilerActionDelegate ExecuteVECAction, PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager, RunManager RunnerManager, DebugHelper DebugHelper,UserOptions UserOptions,System.Collections.Hashtable StandartDirectories, Dictionary<string, CodeFileDocumentControl> OpenDocuments, IWorkbench workbench) { this.StandartDirectories = StandartDirectories; this.ErrorsManager = ErrorsManager; this.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(onChangeVisualEnvironmentState); SetCompilingButtonsEnabled = setCompilingButtonsEnabled; SetDebugButtonsEnabled = setCompilingDebugEnabled; SetStateText = setStateText; AddTextToCompilerMessages = addTextToCompilerMessages; this.beginInvoke = beginInvoke; this.ExecuteSLAction=ExecuteSLAction; this.ExecuteVECAction = ExecuteVECAction; PluginsMenuItem = pluginsMenuItem; PluginsToolStrip = pluginsToolStrip; PluginsController = new VisualPascalABCPlugins.PluginsController(this, PluginsMenuItem, PluginsToolStrip, workbench); this.RunnerManager = RunnerManager; this.DebugHelper = DebugHelper; DebugHelper.Starting += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Starting); DebugHelper.Exited += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Exited); RunnerManager.Starting += new RunManager.RunnerManagerActionDelegate(RunnerManager_Starting); RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited); this.CodeCompletionParserController = WorkbenchServiceFactory.CodeCompletionParserController; this.CodeCompletionParserController.visualEnvironmentCompiler = this; this.UserOptions = UserOptions; this.OpenDocuments = OpenDocuments; }
public VisualEnvironmentCompiler(InvokeDegegate beginInvoke, SetFlagDelegate setCompilingButtonsEnabled, SetFlagDelegate setCompilingDebugEnabled, SetTextDelegate setStateText, SetTextDelegate addTextToCompilerMessages, ToolStripMenuItem pluginsMenuItem, ToolStrip pluginsToolStrip, ExecuteSourceLocationActionDelegate ExecuteSLAction, ExecuteVisualEnvironmentCompilerActionDelegate ExecuteVECAction, PascalABCCompiler.Errors.ErrorsStrategyManager ErrorsManager, RunManager RunnerManager, DebugHelper DebugHelper, UserOptions UserOptions, System.Collections.Hashtable StandartDirectories, Dictionary <string, CodeFileDocumentControl> OpenDocuments, IWorkbench workbench) { this.StandartDirectories = StandartDirectories; this.ErrorsManager = ErrorsManager; this.ChangeVisualEnvironmentState += new ChangeVisualEnvironmentStateDelegate(onChangeVisualEnvironmentState); SetCompilingButtonsEnabled = setCompilingButtonsEnabled; SetDebugButtonsEnabled = setCompilingDebugEnabled; SetStateText = setStateText; AddTextToCompilerMessages = addTextToCompilerMessages; this.beginInvoke = beginInvoke; this.ExecuteSLAction = ExecuteSLAction; this.ExecuteVECAction = ExecuteVECAction; PluginsMenuItem = pluginsMenuItem; PluginsToolStrip = pluginsToolStrip; PluginsController = new VisualPascalABCPlugins.PluginsController(this, PluginsMenuItem, PluginsToolStrip, workbench); this.RunnerManager = RunnerManager; this.DebugHelper = DebugHelper; DebugHelper.Starting += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Starting); DebugHelper.Exited += new DebugHelper.DebugHelperActionDelegate(DebugHelper_Exited); RunnerManager.Starting += new RunManager.RunnerManagerActionDelegate(RunnerManager_Starting); RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited); this.CodeCompletionParserController = WorkbenchServiceFactory.CodeCompletionParserController; this.CodeCompletionParserController.visualEnvironmentCompiler = this; this.UserOptions = UserOptions; this.OpenDocuments = OpenDocuments; }
public WorkbenchRunService() { Workbench = WorkbenchServiceFactory.Workbench; RunnerManager = new RunManager(ReadStringRequest); RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited); RunnerManager.Starting += new RunManager.RunnerManagerActionDelegate(RunnerManager_Started); RunnerManager.OutputStringReceived += new RunManager.TextRecivedDelegate(RunnerManager_OutputStringReceived); RunnerManager.RunnerManagerUnhanledRuntimeException += new RunManager.RunnerManagerUnhanledRuntimeExceptionDelegate(RunnerManager_RunnerManagerUnhanledRuntimeException); DesignerService = WorkbenchServiceFactory.DesignerService; this.DebuggerManager = WorkbenchServiceFactory.DebuggerManager; BuildService = WorkbenchServiceFactory.BuildService; DebuggerOperationsService = WorkbenchServiceFactory.DebuggerOperationsService; DocumentService = WorkbenchServiceFactory.DocumentService; }
//IUserOptions UserOptions; //IVisualEnvironmentCompiler VisualEnvironmentCompiler; public WorkbenchRunService() { //UserOptions = WorkbenchServiceFactory.Workbench.UserOptions; Workbench = WorkbenchServiceFactory.Workbench; //VisualEnvironmentCompiler = WorkbenchServiceFactory.Workbench.VisualEnvironmentCompiler; RunnerManager = new RunManager(ReadStringRequest); RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited); RunnerManager.Starting += new RunManager.RunnerManagerActionDelegate(RunnerManager_Started); RunnerManager.OutputStringReceived += new RunManager.TextRecivedDelegate(RunnerManager_OutputStringReceived); RunnerManager.RunnerManagerUnhanledRuntimeException += new RunManager.RunnerManagerUnhanledRuntimeExceptionDelegate(RunnerManager_RunnerManagerUnhanledRuntimeException); DesignerService = WorkbenchServiceFactory.DesignerService; this.DebuggerManager = WorkbenchServiceFactory.DebuggerManager; BuildService = WorkbenchServiceFactory.BuildService; DebuggerOperationsService = WorkbenchServiceFactory.DebuggerOperationsService; DocumentService = WorkbenchServiceFactory.DocumentService; }
void RunnerManager_OutputStringReceived(string fileName, RunManager.StreamType streamType, string text) { AddTextToOutputWindowSync(fileName, text); }
private void Form1_Load(object sender, EventArgs e) { RunnerManager = new RunManager(ReadStringRequest); //this.Width = 800; //this.Height = 600; UserOptions = new UserOptions(); visualStates = new VisualStates(); string hdir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) + "\\Highlighting\\"; if (Directory.Exists(hdir)) { FileSyntaxProvider = new ICSharpCode.TextEditor.Document.FileSyntaxModeProvider(hdir); ICSharpCode.TextEditor.Document.HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxProvider); string Filter = "", AllFilter = ""; foreach (ICSharpCode.TextEditor.Document.SyntaxMode sm in FileSyntaxProvider.SyntaxModes) { Filter = Tools.MakeFilter(Filter, sm.Name, sm.Extensions); AllFilter = Tools.MakeAllFilter(AllFilter, sm.Name, sm.Extensions); } saveFileDialog1.Filter = openFileDialog1.Filter = Tools.FinishMakeFilter(Filter, AllFilter); } RunnerManager.Exited += new RunManager.RunnerManagerActionDelegate(RunnerManager_Exited); RunnerManager.Started += new RunManager.RunnerManagerActionDelegate(RunnerManager_Started); RunnerManager.OutputStringReceived += new RunManager.TextRecivedDelegate(RunnerManager_OutputStringReceived); RunnerManager.RunnerManagerUnhanledRuntimeException += new RunManager.RunnerManagerUnhanledRuntimeExceptionDelegate(RunnerManager_RunnerManagerUnhanledRuntimeException); FormLeft = this.Left; FormTop = this.Top; FormWidth = this.Width; FormHeight = this.Height; LoadOptions(OptionsFileName); tsOutputWindow.Checked = BottomTabsVisible; StandartDirectories = new Hashtable(StringComparer.InvariantCultureIgnoreCase); StandartDirectories.Add(Constants.SystemDirectoryIdent, System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName)); if (WorkingDirectory == null) WorkingDirectory = PascalABCCompiler.Tools.ReplaceAllKeys(Constants.DefaultWorkingDirectory, StandartDirectories); StandartDirectories.Add(Constants.WorkingDirectoryIdent, WorkingDirectory); AddNewProgramToTab(tabControl1, InstNameNewProgramm(tabControl1)); foreach (string FileName in VisualPascalABC.CommandLineArgs) OpenFile(FileName); dataGridView1.Rows.Add(); ErrorListAddRowsFill(); SetStopEnabled(false); CompilingButtonsEnabled = CloseButtonsEnabled = SaveAllButtonsEnabled = SaveButtonsEnabled = false; NavigBackButtonsEnabled = NavigForwButtonsEnabled = false; try { if (!Directory.Exists(WorkingDirectory)) Directory.CreateDirectory(WorkingDirectory); } catch (Exception exc) { AddTextToCompilerMessages(Form1StringResources.Get("MSGTYPE")+String.Format(Form1StringResources.Get("ERROR_CREATING_WORKDIR_{0}_{1}"), WorkingDirectory,exc.Message)+Environment.NewLine); } }
void RunnerManager_OutputStringReceived(string fileName, RunManager.StreamType streamType, string text) { WorkbenchServiceFactory.OperationsService.AddTextToOutputWindowSync(fileName, text); }