[mapguide-commits] r6520 - in trunk/Tools/Maestro: Maestro Maestro.AddIn.Scripting/Services

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Feb 18 07:32:10 EST 2012


Author: jng
Date: 2012-02-18 04:32:10 -0800 (Sat, 18 Feb 2012)
New Revision: 6520

Modified:
   trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
   trunk/Tools/Maestro/Maestro/Program.cs
Log:
Fix broken prompts due to the SharpDevelop core update and add some more convenience methods to the scripting host application class

Modified: trunk/Tools/Maestro/Maestro/Program.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/Program.cs	2012-02-18 07:02:48 UTC (rev 6519)
+++ trunk/Tools/Maestro/Maestro/Program.cs	2012-02-18 12:32:10 UTC (rev 6520)
@@ -185,7 +185,7 @@
     sealed class MaestroServiceManager : ServiceManager
     {
         static ILoggingService loggingService = new TextWriterLoggingService(BroadcastTextWriter.Instance);
-        static IMessageService messageService = new TextWriterMessageService(Console.Out);
+        static IMessageService messageService = new WinFormsMessageService(); //new TextWriterMessageService(Console.Out);
 
         public override ILoggingService LoggingService
         {

Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs	2012-02-18 07:02:48 UTC (rev 6519)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs	2012-02-18 12:32:10 UTC (rev 6520)
@@ -46,14 +46,25 @@
         }
 
         /// <summary>
-        /// The connection manager
+        /// Returns a list of the names of all currently open connections
         /// </summary>
-        public ServerConnectionManager ConnectionManager
+        /// <returns></returns>
+        public string[] GetConnectionNames()
         {
-            get { return ServiceRegistry.GetService<ServerConnectionManager>(); }
+            return ServiceRegistry.GetService<ServerConnectionManager>().GetConnectionNames().ToArray();
         }
 
         /// <summary>
+        /// Gets the connection by its specified name
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        public IServerConnection GetConnection(string name)
+        {
+            return ServiceRegistry.GetService<ServerConnectionManager>().GetConnection(name);
+        }
+
+        /// <summary>
         /// Gets the XML content of the given resource id
         /// </summary>
         /// <param name="conn"></param>



More information about the mapguide-commits mailing list