[Monodevelop-patches-list] r2709 - in trunk/MonoDevelop/Extras/MonoQuery: . MonoQuery MonoQuery/Commands MonoQuery/Gui MonoQuery/Gui/NodeBuilders
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Wed Aug 3 16:29:18 EDT 2005
Author: lluis
Date: 2005-08-03 16:29:18 -0400 (Wed, 03 Aug 2005)
New Revision: 2709
Modified:
trunk/MonoDevelop/Extras/MonoQuery/ChangeLog
trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/Commands.cs
trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DatabasePad.cs
trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs
trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.addin.xml
Log:
2005-08-03 Lluis Sanchez Gual <lluis at novell.com>
* MonoQuery/Commands/Commands.cs:
* MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs:
* MonoQuery/Gui/DatabasePad.cs: Moved command handlers to node builders.
Modified: trunk/MonoDevelop/Extras/MonoQuery/ChangeLog
===================================================================
--- trunk/MonoDevelop/Extras/MonoQuery/ChangeLog 2005-08-03 12:07:48 UTC (rev 2708)
+++ trunk/MonoDevelop/Extras/MonoQuery/ChangeLog 2005-08-03 20:29:18 UTC (rev 2709)
@@ -1,3 +1,9 @@
+2005-08-03 Lluis Sanchez Gual <lluis at novell.com>
+
+ * MonoQuery/Commands/Commands.cs:
+ * MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs:
+ * MonoQuery/Gui/DatabasePad.cs: Moved command handlers to node builders.
+
2005-08-02 Christian Hergert <christian.hergert at gmail.com>
* MonoQuery.prjx: deleted
Modified: trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/Commands.cs
===================================================================
--- trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/Commands.cs 2005-08-03 12:07:48 UTC (rev 2708)
+++ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/Commands.cs 2005-08-03 20:29:18 UTC (rev 2709)
@@ -70,48 +70,4 @@
dialog.Destroy ();
}
}
-
- public class RemoveConnection : CommandHandler
- {
- protected override void Run ()
- {
- DatabasePad pad = (DatabasePad) MonoDevelop.Gui.WorkbenchSingleton.Workbench.GetPad (typeof (DatabasePad));
- MonoQueryService service = (MonoQueryService) ServiceManager.GetService (typeof (MonoQueryService));
-
- object obj = pad.GetSelectedNode ().DataItem;
- if (obj as DbProviderBase != null)
- service.Providers.Remove ((DbProviderBase) obj);
- }
- }
-
- public class RefreshProviderList : CommandHandler
- {
- protected override void Run ()
- {
- DatabasePad pad = (DatabasePad) MonoDevelop.Gui.WorkbenchSingleton.Workbench.GetPad (typeof (DatabasePad));
- pad.Refresh ();
- }
- }
-
- public class RefreshConnection : CommandHandler
- {
- protected override void Run ()
- {
- DatabasePad pad = (DatabasePad) MonoDevelop.Gui.WorkbenchSingleton.Workbench.GetPad (typeof (DatabasePad));
- object obj = pad.GetSelectedNode ().DataItem;
- if (obj as DbProviderBase != null)
- (obj as DbProviderBase).Refresh ();
- }
- }
-
- public class DisconnectConnection : CommandHandler
- {
- protected override void Run ()
- {
- DatabasePad pad = (DatabasePad) MonoDevelop.Gui.WorkbenchSingleton.Workbench.GetPad (typeof (DatabasePad));
- DbProviderBase provider = (pad.GetSelectedNode ().DataItem as DbProviderBase);
- if (provider != null)
- provider.Close ();
- }
- }
-}
\ No newline at end of file
+}
Modified: trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DatabasePad.cs
===================================================================
--- trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DatabasePad.cs 2005-08-03 12:07:48 UTC (rev 2708)
+++ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DatabasePad.cs 2005-08-03 20:29:18 UTC (rev 2709)
@@ -33,6 +33,8 @@
using MonoDevelop.Core.Services;
using MonoDevelop.Core.Properties;
using MonoDevelop.Gui.Pads;
+using MonoDevelop.Commands;
+using MonoQuery.Commands;
using Mono.Data.Sql;
@@ -52,6 +54,7 @@
OnProvidersChanged (this, null);
}
+ [CommandHandler (MonoQueryCommands.RefreshProviderList)]
public void Refresh ()
{
OnProvidersChanged (this, null);
@@ -64,4 +67,4 @@
LoadTree (service.Providers);
}
}
-}
\ No newline at end of file
+}
Modified: trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs 2005-08-03 12:07:48 UTC (rev 2708)
+++ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs 2005-08-03 20:29:18 UTC (rev 2709)
@@ -31,9 +31,13 @@
using System.Runtime.Remoting.Messaging;
using Mono.Data.Sql;
+using MonoDevelop.Core.Services;
using MonoDevelop.Services;
using MonoDevelop.Gui.Pads;
+using MonoDevelop.Commands;
+using MonoQuery.Commands;
+
namespace MonoQuery
{
public class DatabaseNodeBuilder : TypeNodeBuilder
@@ -73,6 +77,12 @@
}
}
+ public override Type CommandHandlerType {
+ get {
+ return typeof (DatabaseNodeCommandHandler);
+ }
+ }
+
public override void OnNodeAdded (object dataObject)
{
DbProviderBase provider = (DbProviderBase) dataObject;
@@ -198,4 +208,29 @@
builder.AddChild (child);
}
}
-}
\ No newline at end of file
+
+ public class DatabaseNodeCommandHandler: NodeCommandHandler
+ {
+ [CommandHandler (MonoQueryCommands.RemoveConnection)]
+ protected void OnRemoveConnection ()
+ {
+ MonoQueryService service = (MonoQueryService) ServiceManager.GetService (typeof (MonoQueryService));
+ DbProviderBase provider = (DbProviderBase) CurrentNode.DataItem;
+ service.Providers.Remove (provider);
+ }
+
+ [CommandHandler (MonoQueryCommands.RefreshConnection)]
+ protected void OnRefreshConnection ()
+ {
+ DbProviderBase provider = (DbProviderBase) CurrentNode.DataItem;
+ provider.Refresh ();
+ }
+
+ [CommandHandler (MonoQueryCommands.DisconnectConnection)]
+ protected void OnDisconnectConnection ()
+ {
+ DbProviderBase provider = (DbProviderBase) CurrentNode.DataItem;
+ provider.Close ();
+ }
+ }
+}
Modified: trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.addin.xml
===================================================================
--- trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.addin.xml 2005-08-03 12:07:48 UTC (rev 2708)
+++ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.addin.xml 2005-08-03 20:29:18 UTC (rev 2709)
@@ -57,18 +57,14 @@
_label = "Add connection"
icon = "md-mono-query-addconnection"/>
<Command id = "MonoQuery.Commands.MonoQueryCommands.RemoveConnection"
- defaultHandler = "MonoQuery.Commands.RemoveConnection"
_label = "Remove"/>
<Command id = "MonoQuery.Commands.MonoQueryCommands.RefreshProviderList"
- defaultHandler = "MonoQuery.Commands.RefreshProviderList"
_label = "Refresh"
icon = "md-browser-refresh"/>
<Command id = "MonoQuery.Commands.MonoQueryCommands.RefreshConnection"
- defaultHandler = "MonoQuery.Commands.RefreshConnection"
_label = "Refresh"
icon = "md-browser-refresh"/>
<Command id = "MonoQuery.Commands.MonoQueryCommands.DisconnectConnection"
- defaultHandler = "MonoQuery.Commands.DisconnectConnection"
_label = "Disconnect"
icon = "md-mono-query-disconnect"/>
</Extension>
@@ -86,4 +82,4 @@
<CommandItem id = "MonoQuery.Commands.MonoQueryCommands.RefreshConnection"/>
</Extension>
-</AddIn>
\ No newline at end of file
+</AddIn>
More information about the Monodevelop-patches-list
mailing list