[mapguide-commits] r6525 - trunk/Tools/Maestro/Maestro.Editors/LayerDefinition

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Feb 18 12:54:49 EST 2012


Author: jng
Date: 2012-02-18 09:54:49 -0800 (Sat, 18 Feb 2012)
New Revision: 6525

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
Log:
#1898: When loading the layer display property list, purge any invalid property mappings first.

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs	2012-02-18 17:35:31 UTC (rev 6524)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs	2012-02-18 17:54:49 UTC (rev 6525)
@@ -87,6 +87,7 @@
                 if (cls != null)
                 {
                     grdProperties.Rows.Clear();
+                    RemoveInvalidMappings(cls);
                     foreach (var col in cls.Properties)
                     {
                         if (col.Type == OSGeo.MapGuide.MaestroAPI.Schema.PropertyDefinitionType.Data)
@@ -120,6 +121,21 @@
             }
         }
 
+        private void RemoveInvalidMappings(OSGeo.MapGuide.MaestroAPI.Schema.ClassDefinition cls)
+        {
+            var remove = new List<INameStringPair>();
+            foreach (var mp in _vl.PropertyMapping)
+            {
+                if (cls.FindProperty(mp.Name) == null)
+                    remove.Add(mp);
+            }
+
+            foreach (var mp in remove)
+            {
+                _vl.RemovePropertyMapping(mp);
+            }
+        }
+
         private void btnCheckAll_Click(object sender, EventArgs e)
         {
             foreach (DataGridViewRow row in grdProperties.Rows)



More information about the mapguide-commits mailing list