Exemplo n.º 1
0
 /// <summary>
 /// Starts to run a build inside the SharpDevelop GUI.
 /// Only one build can run inside the GUI at one time.
 /// </summary>
 /// <param name="project">The project/solution to build.</param>
 /// <param name="options">The build options.</param>
 public static void BuildInGui(IBuildable project, BuildOptions options)
 {
     if (project == null)
     {
         throw new ArgumentNullException("project");
     }
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     WorkbenchSingleton.AssertMainThread();
     if (guiBuildProgressMonitor != null)
     {
         BuildResults results = new BuildResults();
         results.Add(new BuildError(null, Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning")));
         results.Result = BuildResultCode.MSBuildAlreadyRunning;
         if (options.Callback != null)
         {
             options.Callback(results);
         }
     }
     else
     {
         guiBuildProgressMonitor = new CancellableProgressMonitor(StatusBarService.CreateProgressMonitor());
         Gui.WorkbenchSingleton.Workbench.GetPad(typeof(Gui.CompilerMessageView)).BringPadToFront();
         GuiBuildStarted.RaiseEvent(null, new BuildEventArgs(project, options));
         StartBuild(project, options,
                    new MessageViewSink(TaskService.BuildMessageViewCategory),
                    guiBuildProgressMonitor);
     }
 }
Exemplo n.º 2
0
		/// <summary>
		/// Starts to run a build inside the SharpDevelop GUI.
		/// Only one build can run inside the GUI at one time.
		/// </summary>
		/// <param name="project">The project/solution to build.</param>
		/// <param name="options">The build options.</param>
		public static void BuildInGui(IBuildable project, BuildOptions options)
		{
			if (project == null)
				throw new ArgumentNullException("project");
			if (options == null)
				throw new ArgumentNullException("options");
			WorkbenchSingleton.AssertMainThread();
			if (guiBuildProgressMonitor != null) {
				BuildResults results = new BuildResults();
				results.Add(new BuildError(null, Core.ResourceService.GetString("MainWindow.CompilerMessages.MSBuildAlreadyRunning")));
				results.Result = BuildResultCode.MSBuildAlreadyRunning;
				if (options.Callback != null) {
					options.Callback(results);
				}
			} else {
				guiBuildProgressMonitor = new CancellableProgressMonitor(StatusBarService.CreateProgressMonitor());
				Gui.WorkbenchSingleton.Workbench.GetPad(typeof(Gui.CompilerMessageView)).BringPadToFront();
				GuiBuildStarted.RaiseEvent(null, new BuildEventArgs(project, options));
				StartBuild(project, options,
				           new MessageViewSink(TaskService.BuildMessageViewCategory),
				           guiBuildProgressMonitor);
			}
		}