void Run(string[] args) { SharpSnippetCompilerManager.Init(); app = new App(); // Force creation of the debugger before workbench is created. IDebugger debugger = DebuggerService.CurrentDebugger; mainWindow = new MainWindow(); var workbench = new Workbench(mainWindow); WorkbenchSingleton.InitializeWorkbench(workbench, new WorkbenchLayout()); ViewModels.MainViewModel.AddInitialPads(); SnippetCompilerProject.Load(); IProject project = GetCurrentProject(); ProjectService.CurrentProject = project; LoadFiles(project); // ParserService.StartParserThread(); try { app.Run(WorkbenchSingleton.MainWindow); } finally { try { // Save properties //PropertyService.Save(); } catch (Exception ex) { MessageService.ShowException(ex, "Properties could not be saved."); } } }
static void InitializeWorkbench(Workbench workbench, IWorkbenchLayout layout) { SD.Services.AddService(typeof(IWorkbench), workbench); SD.Services.AddService(typeof(IWinFormsService), new WinFormsService()); SD.Services.AddService(typeof(IWinFormsToolbarService), new WinFormsToolbarService()); SD.Services.AddService(typeof(IWinFormsMenuService), new WinFormsMenuService()); SD.Services.AddService(typeof(IProjectService), new SDProjectService()); SD.Services.AddService(typeof(IBuildService), new BuildService()); SD.Services.AddService(typeof(IParserService), new ParserService()); SD.Services.AddService(typeof(IFileService), new FileService()); SD.Services.AddService(typeof(IStatusBarService), new StatusBarService()); SD.Services.AddService(typeof(IMSBuildEngine), new MSBuildEngine()); SD.Services.AddService(typeof(IDisplayBindingService), new DisplayBindingService()); SD.Services.AddService(typeof(IBookmarkManager), new BookmarkManager()); LanguageService.ValidateLanguage(); TaskService.Initialize(); CustomToolsService.Initialize(); workbench.Initialize(); workbench.SetMemento(PropertyService.NestedProperties(workbenchMemento)); workbench.WorkbenchLayout = layout; var applicationStateInfoService = SD.GetService<ApplicationStateInfoService>(); if (applicationStateInfoService != null) { applicationStateInfoService.RegisterStateGetter(activeContentState, delegate { return SD.Workbench.ActiveContent; }); } WorkbenchSingleton.OnWorkbenchCreated(); // initialize workbench-dependent services: NavigationService.InitializeService(); workbench.ActiveContentChanged += delegate { //Debug.WriteLine("ActiveContentChanged to " + workbench.ActiveContent); LoggingService.Debug("ActiveContentChanged to " + workbench.ActiveContent); }; workbench.ActiveViewContentChanged += delegate { //Debug.WriteLine("ActiveViewContentChanged to " + workbench.ActiveViewContent); LoggingService.Debug("ActiveViewContentChanged to " + workbench.ActiveViewContent); }; workbench.ActiveWorkbenchWindowChanged += delegate { //Debug.WriteLine("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); LoggingService.Debug("ActiveWorkbenchWindowChanged to " + workbench.ActiveWorkbenchWindow); }; }
void Run(string[] args) { SharpSnippetCompilerManager.Init(); mainForm = new MainForm(); // Force creation of the debugger before workbench is created. IDebugger debugger = DebuggerService.CurrentDebugger; Workbench workbench = new Workbench(mainForm); WorkbenchSingleton.InitializeWorkbench(workbench, new WorkbenchLayout()); PadDescriptor errorList = workbench.GetPad(typeof(ErrorListPad)); errorList.CreatePad(); mainForm.ErrorList = errorList.PadContent.Control; PadDescriptor outputList = workbench.GetPad(typeof(CompilerMessageView)); outputList.CreatePad(); mainForm.OutputList = outputList.PadContent.Control; mainForm.Visible = true; SnippetCompilerProject.Load(); IProject project = GetCurrentProject(); ProjectService.CurrentProject = project; LoadFiles(project); ParserService.StartParserThread(); //WorkbenchSingleton.SafeThreadAsyncCall(new Action<Program>(LoadFile)); try { Application.Run(mainForm); } finally { try { // Save properties //PropertyService.Save(); } catch (Exception ex) { MessageService.ShowError(ex, "Properties could not be saved."); } } }
void Run(string[] args) { SharpSnippetCompilerManager.Init(); app = new App(); SD.Services.AddService(typeof(IMessageLoop), new DispatcherMessageLoop(app.Dispatcher, SynchronizationContext.Current)); mainWindow = new MainWindow(); var workbench = new Workbench(mainWindow); InitializeWorkbench(workbench, new WorkbenchLayout()); ViewModels.MainViewModel.AddInitialPads(); SnippetCompilerProject.Load(); IProject project = GetCurrentProject(); ProjectService.CurrentProject = project; LoadFiles(project); try { app.Run(SD.Workbench.MainWindow); } finally { try { // Save properties //PropertyService.Save(); } catch (Exception ex) { MessageService.ShowException(ex, "Properties could not be saved."); } } }