[mapguide-commits] r5937 - trunk/Tools/Maestro/Maestro.Base/UI

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Jun 22 08:18:32 EDT 2011


Author: jng
Date: 2011-06-22 05:18:32 -0700 (Wed, 22 Jun 2011)
New Revision: 5937

Modified:
   trunk/Tools/Maestro/Maestro.Base/UI/OutboundRequestViewer.cs
Log:
#1725: Disable listening for outbound requests if Outbound Requests UI is not visible.


Modified: trunk/Tools/Maestro/Maestro.Base/UI/OutboundRequestViewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/OutboundRequestViewer.cs	2011-06-20 12:41:46 UTC (rev 5936)
+++ trunk/Tools/Maestro/Maestro.Base/UI/OutboundRequestViewer.cs	2011-06-22 12:18:32 UTC (rev 5937)
@@ -28,6 +28,7 @@
 using System.IO;
 using ICSharpCode.Core;
 using Maestro.Base.Services;
+using Maestro.Base.UI.Preferences;
 
 namespace Maestro.Base.UI
 {
@@ -38,17 +39,22 @@
             InitializeComponent();
             this.Title = this.Description = Properties.Resources.Content_OutboundRequests;
 
-            var connMgr = ServiceRegistry.GetService<ServerConnectionManager>();
-            connMgr.ConnectionAdded += (s, args) =>
+            //This is okay because changing the value requires a restart, so it will either be listening
+            //or not and that will remain in effect for the duration of the application running.
+            if (PropertyService.Get(ConfigProperties.ShowOutboundRequests, ConfigProperties.DefaultShowOutboundRequests))
             {
-                var conn = connMgr.GetConnection(args);
-                conn.RequestDispatched += OnRequestDispatched;
-            };
-            connMgr.ConnectionRemoving += (s, ce) =>
-            {
-                var conn = connMgr.GetConnection(ce.ConnectionName);
-                conn.RequestDispatched -= OnRequestDispatched;
-            };
+                var connMgr = ServiceRegistry.GetService<ServerConnectionManager>();
+                connMgr.ConnectionAdded += (s, args) =>
+                {
+                    var conn = connMgr.GetConnection(args);
+                    conn.RequestDispatched += OnRequestDispatched;
+                };
+                connMgr.ConnectionRemoving += (s, ce) =>
+                {
+                    var conn = connMgr.GetConnection(ce.ConnectionName);
+                    conn.RequestDispatched -= OnRequestDispatched;
+                };
+            }
         }
 
         protected override void OnLoad(EventArgs e)



More information about the mapguide-commits mailing list