[mapguide-commits] r6699 - in branches/2.4/MgDev/Desktop: DotNetHarness MapViewer MapViewerTest

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun May 27 21:39:46 PDT 2012


Author: jng
Date: 2012-05-27 21:39:46 -0700 (Sun, 27 May 2012)
New Revision: 6699

Removed:
   branches/2.4/MgDev/Desktop/DotNetHarness/Platform.ini
Modified:
   branches/2.4/MgDev/Desktop/DotNetHarness/DotNetHarness.csproj
   branches/2.4/MgDev/Desktop/MapViewer/MgLayerSelectionHandler.cs
   branches/2.4/MgDev/Desktop/MapViewerTest/MgAppWindow.cs
Log:
mg-desktop: Change the MgLayerSelectionHandler to pass an MgSelectionSet instead of an MgFeatureReader, as passing a feature reader is impractical if there are multiple subscribers to the SelectionMade event. Handlers would then interrogate the LayerNames property of the MgSelectionSet to see if it contains features from the layer they're interested in.

Modified: branches/2.4/MgDev/Desktop/DotNetHarness/DotNetHarness.csproj
===================================================================
--- branches/2.4/MgDev/Desktop/DotNetHarness/DotNetHarness.csproj	2012-05-28 02:03:52 UTC (rev 6698)
+++ branches/2.4/MgDev/Desktop/DotNetHarness/DotNetHarness.csproj	2012-05-28 04:39:46 UTC (rev 6699)
@@ -301,7 +301,8 @@
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
     </Compile>
-    <None Include="Platform.ini">
+    <None Include="..\MgDesktop\Platform.ini">
+      <Link>Platform.ini</Link>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
     <None Include="Properties\Settings.settings">

Deleted: branches/2.4/MgDev/Desktop/DotNetHarness/Platform.ini
===================================================================
(Binary files differ)

Modified: branches/2.4/MgDev/Desktop/MapViewer/MgLayerSelectionHandler.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewer/MgLayerSelectionHandler.cs	2012-05-28 02:03:52 UTC (rev 6698)
+++ branches/2.4/MgDev/Desktop/MapViewer/MgLayerSelectionHandler.cs	2012-05-28 04:39:46 UTC (rev 6699)
@@ -5,7 +5,7 @@
 
 namespace OSGeo.MapGuide.Viewer
 {
-    public delegate void MgLayerSelectionEventHandler(string layerName, MgFeatureReader selectedFeatures);
+    public delegate void MgLayerSelectionEventHandler(MgSelectionSet selectedFeatures);
 
     [DefaultEvent("SelectionMade")]
     [ToolboxItem(true)]
@@ -54,8 +54,8 @@
                         var h = this.SelectionMade;
                         if (h != null)
                         {
-                            var reader = sel.GetSelectedFeatures(layers[layerName], layers[layerName].FeatureClassName, false);
-                            h(layerName, reader);
+                            var selectionSet = new MgSelectionSet(sel, _viewer.GetProvider().AllPropertyMappings);
+                            h(selectionSet);
                         }
                     }
                 }

Modified: branches/2.4/MgDev/Desktop/MapViewerTest/MgAppWindow.cs
===================================================================
--- branches/2.4/MgDev/Desktop/MapViewerTest/MgAppWindow.cs	2012-05-28 02:03:52 UTC (rev 6698)
+++ branches/2.4/MgDev/Desktop/MapViewerTest/MgAppWindow.cs	2012-05-28 04:39:46 UTC (rev 6699)
@@ -104,15 +104,13 @@
             }
         }
 
-        private void mgLayerSelectionHandler1_SelectionMade(string layerName, MgFeatureReader selectedFeatures)
+        private void mgLayerSelectionHandler1_SelectionMade(MgSelectionSet selectedFeatures)
         {
-            int count = 0;
-            while (selectedFeatures.ReadNext())
+            if (Array.IndexOf(selectedFeatures.LayerNames, "Parcels") >= 0)
             {
-                count++;
+                MgFeature[] features = selectedFeatures.GetFeaturesForLayer("Parcels");
+                MessageBox.Show(features.Length + " parcels selected");
             }
-            selectedFeatures.Close();
-            MessageBox.Show(count + " parcels selected");
         }
 
         private void loadCompactViewerComponent_Invoked(object sender, EventArgs e)



More information about the mapguide-commits mailing list