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.");
                }
            }
        }
        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.");
                }
            }
        }
Beispiel #3
0
        string GetNewFileName()
        {
            string fileName   = SnippetCompilerProject.GetFullFileName("Snippet1.cs");
            string baseFolder = Path.GetDirectoryName(fileName);
            int    count      = 1;

            while (File.Exists(fileName))
            {
                count++;
                fileName = Path.Combine(baseFolder, "Snippet" + count.ToString() + ".cs");
            }
            return(fileName);
        }
Beispiel #4
0
        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.");
                }
            }
        }