[Monodevelop-patches-list] r2058 - in trunk/MonoDevelop/Core/src/Main/Base: . Gui/Pads Gui/Pads/ClassScout Gui/Pads/ProjectBrowser Gui/Workbench Services Services/DispatchService Services/Project Services/Tasks

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Tue Dec 7 15:36:29 EST 2004


Author: lluis
Date: 2004-12-07 15:36:29 -0500 (Tue, 07 Dec 2004)
New Revision: 2058

Added:
   trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncAbstractService.cs
Modified:
   trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/OpenTaskView.cs
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
   trunk/MonoDevelop/Core/src/Main/Base/Makefile.am
   trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/DispatchService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncContext.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs
Log:
2004-12-07  Lluis Sanchez Gual  <lluis at novell.com>

	* Services/DispatchService/DispatchService.cs: Made some method non-static.
	* Services/DispatchService/GuiSyncContext.cs: Minor fix.
	* Services/Tasks/TaskService.cs: Added ShowTasks method, which brings
	to the front the task view.
	* Services/Project/DefaultProjectService.cs: It is the resposibility
	of the subscriber to handle the event in the right thread.
	* Services/MessageService.cs: Handle gui-thread transitions automatically
	by deriving from GuiSyncAbstractService.
	* Gui/Workbench/DefaultWorkbench.cs,
	* Gui/Pads/OpenTaskView.cs,
	* Gui/Pads/TerminalPad.cs,
	* Gui/Pads/ProjectBrowser/ProjectBrowserView.cs,
	* Gui/Pads/ClassScout/ClassScout.cs: Subscribe to service events using
	gui-thread aware delegates.
	* Makefile.am: New file.



Modified: trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-12-07 20:36:29 UTC (rev 2058)
@@ -1,3 +1,21 @@
+2004-12-07  Lluis Sanchez Gual  <lluis at novell.com>
+
+	* Services/DispatchService/DispatchService.cs: Made some method non-static.
+	* Services/DispatchService/GuiSyncContext.cs: Minor fix.
+	* Services/Tasks/TaskService.cs: Added ShowTasks method, which brings
+	to the front the task view.
+	* Services/Project/DefaultProjectService.cs: It is the resposibility
+	of the subscriber to handle the event in the right thread.
+	* Services/MessageService.cs: Handle gui-thread transitions automatically
+	by deriving from GuiSyncAbstractService.
+	* Gui/Workbench/DefaultWorkbench.cs,
+	* Gui/Pads/OpenTaskView.cs,
+	* Gui/Pads/TerminalPad.cs,
+	* Gui/Pads/ProjectBrowser/ProjectBrowserView.cs,
+	* Gui/Pads/ClassScout/ClassScout.cs: Subscribe to service events using
+	gui-thread aware delegates.
+	* Makefile.am: New file.
+
 2004-12-06  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* Services/DispatchService/DispatchService.cs: Added support for

Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -97,12 +97,12 @@
 		
 		public ClassScout() : base (false, TreeNodeComparer.GtkDefault)
 		{
-			changeClassInformationHandler = new ClassInformationEventHandler(OnClassInformationChanged);
+			changeClassInformationHandler = (ClassInformationEventHandler) Runtime.DispatchService.GuiDispatch (new ClassInformationEventHandler (OnClassInformationChanged));
 			
 			LabelEdit     = false;
 
-			Runtime.ProjectService.CombineOpened += new CombineEventHandler(OnCombineOpen);
-			Runtime.ProjectService.CombineClosed += new CombineEventHandler(OnCombineClosed);
+			Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler(OnCombineOpen));
+			Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler(OnCombineClosed));
 
 			Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
 			sw.Add(this);
@@ -140,16 +140,10 @@
 			Nodes.Clear();
 		}
 		
-		void OnClassInformationChanged(object sender, ClassInformationEventArgs e)
+		void OnClassInformationChanged (object sender, ClassInformationEventArgs e)
 		{
-			Runtime.DispatchService.GuiDispatch (new StatefulMessageHandler (ChangeClassInfo), e);
+			ChangeClassInformation (Nodes, e);
 		}
-		
-		void ChangeClassInfo (object e)
-		{
-			ClassInformationEventArgs ce = (ClassInformationEventArgs) e;
-			ChangeClassInformation (Nodes, ce);
-		}
 
 		private void OnNodeActivated(object sender, Gtk.RowActivatedArgs args)
 		{

Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/OpenTaskView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/OpenTaskView.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/OpenTaskView.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -75,11 +75,11 @@
 			sw.ShadowType = ShadowType.In;
 			sw.Add (view);
 			
-			Runtime.TaskService.TasksChanged     += new EventHandler (ShowResults);
-			Runtime.TaskService.TaskAdded        += new TaskEventHandler (TaskAdded);
-			Runtime.ProjectService.EndBuild      += new EventHandler (SelectTaskView);
-			Runtime.ProjectService.CombineOpened += new CombineEventHandler (OnCombineOpen);
-			Runtime.ProjectService.CombineClosed += new CombineEventHandler (OnCombineClosed);
+			Runtime.TaskService.TasksChanged     += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (ShowResults));
+			Runtime.TaskService.TaskAdded        += (TaskEventHandler) Runtime.DispatchService.GuiDispatch (new TaskEventHandler (TaskAdded));
+			Runtime.ProjectService.EndBuild      += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SelectTaskView));
+			Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
+			Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
 			view.RowActivated            += new RowActivatedHandler (OnRowActivated);
 		}
 

Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -76,9 +76,9 @@
 		{
 			WorkbenchSingleton.Workbench.ActiveWorkbenchWindowChanged += new EventHandler(ActiveWindowChanged);
 
-			Runtime.ProjectService.CombineOpened += new CombineEventHandler(OpenCombine);
-			Runtime.ProjectService.CombineClosed += new CombineEventHandler(CloseCombine);
-			Runtime.Properties.PropertyChanged += new PropertyEventHandler (TrackPropertyChange);
+			Runtime.ProjectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OpenCombine));
+			Runtime.ProjectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (CloseCombine));
+			Runtime.Properties.PropertyChanged += (PropertyEventHandler) Runtime.DispatchService.GuiDispatch (new PropertyEventHandler (TrackPropertyChange));
 
 			Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
 			sw.Add(this);

Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -16,7 +16,6 @@
 		Frame frame = new Frame ();
 		Terminal term;
 
-		TaskService taskService = (TaskService) MonoDevelop.Core.Services.ServiceManager.Services.GetService (typeof (TaskService));
 		IProjectService projectService = (IProjectService) ServiceManager.Services.GetService (typeof (IProjectService));
 		PropertyService propertyService = (PropertyService) ServiceManager.Services.GetService (typeof (PropertyService));
 		
@@ -98,10 +97,10 @@
 			sw.Add (hbox);
 			frame.Add (sw);
 			
-			taskService.CompilerOutputChanged += new EventHandler (SetOutput);
-			projectService.StartBuild += new EventHandler (SelectMessageView);
-			projectService.CombineClosed += new CombineEventHandler (OnCombineClosed);
-			projectService.CombineOpened += new CombineEventHandler (OnCombineOpen);
+			Runtime.TaskService.CompilerOutputChanged += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SetOutput));
+			projectService.StartBuild += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (SelectMessageView));
+			projectService.CombineClosed += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineClosed));
+			projectService.CombineOpened += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler (OnCombineOpen));
 		}
 
 		void OnChildExited (object o, EventArgs args)
@@ -140,7 +139,7 @@
 
 		void SetOutput2 ()
 		{
-			term.Feed (taskService.CompilerOutput.Replace ("\n", "\r\n"));
+			term.Feed (Runtime.TaskService.CompilerOutput.Replace ("\n", "\r\n"));
 		}
 		
 		void SetOutput (object sender, EventArgs e)
@@ -149,7 +148,7 @@
 				SetOutput2 ();
 			}
 			else {
-				term.Feed (taskService.CompilerOutput.Replace ("\n", "\r\n"));
+				term.Feed (Runtime.TaskService.CompilerOutput.Replace ("\n", "\r\n"));
 			}
 		}
 		

Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -236,8 +236,8 @@
 			// FIXME: GTKize
 			ActiveWorkbenchWindowChanged += new EventHandler(UpdateMenu);
 			
-			Runtime.ProjectService.CurrentProjectChanged += new ProjectEventHandler(SetProjectTitle);
-			Runtime.ProjectService.CombineOpened         += new CombineEventHandler(CombineOpened);
+			Runtime.ProjectService.CurrentProjectChanged += (ProjectEventHandler) Runtime.DispatchService.GuiDispatch (new ProjectEventHandler(SetProjectTitle));
+			Runtime.ProjectService.CombineOpened         += (CombineEventHandler) Runtime.DispatchService.GuiDispatch (new CombineEventHandler(CombineOpened));
 
 			Runtime.FileService.FileRemoved += new FileEventHandler(CheckRemovedFile);
 			Runtime.FileService.FileRenamed += new FileEventHandler(CheckRenamedFile);

Modified: trunk/MonoDevelop/Core/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Makefile.am	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Makefile.am	2004-12-07 20:36:29 UTC (rev 2058)
@@ -213,6 +213,7 @@
 Services/DispatchService/DispatchService.cs \
 Services/DispatchService/FreeDispatchAttribute.cs \
 Services/DispatchService/GuiSyncContext.cs \
+Services/DispatchService/GuiSyncAbstractService.cs \
 Services/DispatchService/GuiSyncObject.cs \
 Services/DispatchService/SyncContext.cs \
 Services/DispatchService/SyncContextAttribute.cs \

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/DispatchService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/DispatchService.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/DispatchService.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -14,10 +14,10 @@
 		Thread thrBackground;
 		uint iIdle = 0;
 		GLib.IdleHandler handler;
-		static int guiThreadId;
-		static GuiSyncContext guiContext;
+		int guiThreadId;
+		GuiSyncContext guiContext;
 		const string errormsg = "An exception was thrown while dispatching a method call in the UI thread.";
-		internal static bool DispatchDebug;
+		internal bool DispatchDebug;
 
 		public override void InitializeService ()
 		{
@@ -87,18 +87,18 @@
 			}
 		}
 		
-		public static bool IsGuiThread
+		public bool IsGuiThread
 		{
 			get { return guiThreadId == AppDomain.GetCurrentThreadId(); }
 		}
 		
-		public static void AssertGuiThread ()
+		public void AssertGuiThread ()
 		{
 			if (guiThreadId != AppDomain.GetCurrentThreadId())
 				throw new InvalidOperationException ("This method can only be called in the GUI thread");
 		}
 		
-		public static Delegate GuiDispatch (Delegate del)
+		public Delegate GuiDispatch (Delegate del)
 		{
 			return guiContext.CreateSynchronizedDelegate (del);
 		}
@@ -190,7 +190,7 @@
 		{
 			callback = cb;
 			this.isSynchronous = isSynchronous;
-			if (DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
+			if (Runtime.DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
 		}
 
 		public virtual void Run ()
@@ -229,7 +229,7 @@
 			data = state;
 			callback = cb;
 			this.isSynchronous = isSynchronous;
-			if (DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
+			if (Runtime.DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
 		}
 		
 		public override void Run ()

Added: trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncAbstractService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncAbstractService.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncAbstractService.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -0,0 +1,37 @@
+using System;
+using MonoDevelop.Core.Services;
+
+namespace MonoDevelop.Services
+{
+	public class GuiSyncAbstractService : GuiSyncObject, IService
+	{
+		[FreeDispatch]
+		public virtual void InitializeService()
+		{
+			OnInitialize(EventArgs.Empty);
+		}
+		
+		
+		public virtual void UnloadService()
+		{
+			OnUnload(EventArgs.Empty);
+		}
+		
+		protected virtual void OnInitialize(EventArgs e)
+		{
+			if (Initialize != null) {
+				Initialize(this, e);
+			}
+		}
+		
+		protected virtual void OnUnload(EventArgs e)
+		{
+			if (Unload != null) {
+				Unload(this, e);
+			}
+		}
+		
+		public event EventHandler Initialize;
+		public event EventHandler Unload;
+	}
+}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncContext.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncContext.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/DispatchService/GuiSyncContext.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -18,11 +18,10 @@
 			if (dispatcher == null)
 				dispatcher = Runtime.DispatchService;
 				
-			if (DispatchService.IsGuiThread)
+			if (dispatcher.IsGuiThread)
 				cb (ob);
-			else {
+			else
 				dispatcher.GuiSyncDispatch (cb, ob);
-			}
 		}
 		
 		public override void AsyncDispatch (StatefulMessageHandler cb, object ob)

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -18,7 +18,7 @@
 	/// <summary>
 	/// This interface must be implemented by all services.
 	/// </summary>
-	public class MessageService : AbstractService, IMessageService
+	public class MessageService : GuiSyncAbstractService, IMessageService
 	{
 		StringParserService stringParserService = Runtime.StringParserService;
 		
@@ -49,29 +49,22 @@
 			}
 		}
 
-		public void ShowError(Exception ex, string message)
+		public void ShowError (Exception ex, string message)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
-			dispatcher.GuiDispatch (new StatefulMessageHandler (realShowError), new ErrorContainer (ex, message));
-		}
-
-		private void realShowError (object state)
-		{
-			ErrorContainer container = (ErrorContainer)state;
 			string msg = String.Empty;
 			
-			if (container.message != null) {
-				msg += container.message;
+			if (message != null) {
+				msg += message;
 			}
 			
-			if (container.message != null && container.ex != null) {
+			if (message != null && ex != null) {
 				msg += "\n\n";
 			}
 			
-			if (container.ex != null) {
-				msg += "Exception occurred: " + container.ex.ToString();
+			if (ex != null) {
+				msg += "Exception occurred: " + ex.ToString();
 			}
-			Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, container.message);
+			Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, message);
 			md.Response += new Gtk.ResponseHandler (OnErrorResponse);
 			md.ShowAll ();
 		}
@@ -83,13 +76,6 @@
 		
 		public void ShowWarning(string message)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
-			dispatcher.GuiDispatch (new StatefulMessageHandler (realShowWarning), message);
-		}
-
-		private void realShowWarning (object state)
-		{
-			string message = state as string;
 			Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, message);
 			md.Response += new Gtk.ResponseHandler (OnWarningResponse);
 			md.ShowAll ();
@@ -156,13 +142,6 @@
 		
 		public void ShowMessage(string message, string caption)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
-			dispatcher.GuiDispatch (new StatefulMessageHandler (realShowMessage), message);
-		}
-
-		void realShowMessage (object state)
-		{
-			string message = state as string;
 			Gtk.MessageDialog md = new Gtk.MessageDialog ((Gtk.Window) WorkbenchSingleton.Workbench, Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Info, Gtk.ButtonsType.Ok, message);
 			md.Response += new Gtk.ResponseHandler(OnMessageResponse);
 			md.ShowAll ();

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -587,16 +587,10 @@
 		{
 			GenerateMakefiles ();
 			if (CombineOpened != null) {
-				Runtime.DispatchService.GuiDispatch (new StatefulMessageHandler (dispatchOpened), e);
-				//CombineOpened(this, e);
+				CombineOpened(this, e);
 			}
 		}
 
-		void dispatchOpened (object args)
-		{
-			CombineOpened (this, (CombineEventArgs)args);
-		}
-		
 		protected virtual void OnCombineClosed(CombineEventArgs e)
 		{
 			if (CombineClosed != null) {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs	2004-12-06 20:40:45 UTC (rev 2057)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs	2004-12-07 20:36:29 UTC (rev 2058)
@@ -10,6 +10,7 @@
 
 using MonoDevelop.Core.Services;
 using MonoDevelop.Gui;
+using MonoDevelop.Gui.Pads;
 using MonoDevelop.Internal.Project;
 
 namespace MonoDevelop.Services
@@ -19,6 +20,7 @@
 		ArrayList tasks  = new ArrayList();
 		string    compilerOutput = String.Empty;
 		
+		[FreeDispatch]
 		public ICollection Tasks {
 			get {
 				return tasks;
@@ -89,6 +91,17 @@
 			OnTasksChanged (null);
 		}
 		
+		public void ShowTasks ()
+		{
+			Runtime.DispatchService.GuiDispatch (new MessageHandler (ShowTasksCallback));
+		}
+		
+		void ShowTasksCallback ()
+		{
+			OpenTaskView taskView = Runtime.Gui.Workbench.GetPad(typeof(OpenTaskView)) as OpenTaskView;
+			if (taskView != null) taskView.BringToFront();
+		}
+		
 		protected virtual void OnCompilerOutputChanged(EventArgs e)
 		{
 			if (CompilerOutputChanged != null) {




More information about the Monodevelop-patches-list mailing list