[mapguide-commits] r5975 - trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Jul 6 08:40:02 EDT 2011


Author: jng
Date: 2011-07-06 05:40:02 -0700 (Wed, 06 Jul 2011)
New Revision: 5975

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
Log:
Fix existing symbol instances not being loaded up into the Symbol Instances dialog


Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2011-07-06 12:32:56 UTC (rev 5974)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2011-07-06 12:40:02 UTC (rev 5975)
@@ -52,6 +52,9 @@
             _cls = cls;
             _provider = provider;
             _featureSourceId = featureSourceId;
+
+            foreach (var inst in _comp.SymbolInstance)
+                AddInstance(inst, false);
         }
 
         private void btnClose_Click(object sender, EventArgs e)
@@ -67,12 +70,12 @@
                 if (picker.ShowDialog() == DialogResult.OK)
                 {
                     var symRef = _comp.CreateSymbolReference(picker.ResourceID);
-                    AddInstance(symRef);
+                    AddInstance(symRef, true);
                 }
             }
         }
 
-        private void AddInstance(ISymbolInstance symRef)
+        private void AddInstance(ISymbolInstance symRef, bool add)
         {
             var li = new ListViewItem();
             li.ImageIndex = (symRef.Reference.Type == SymbolInstanceType.Reference) ? 0 : 1;
@@ -83,7 +86,8 @@
                 li.Text = Properties.Resources.InlineSymbolDefinition;
 
             lstInstances.Items.Add(li);
-            _comp.AddSymbolInstance(symRef);
+            if (add)
+                _comp.AddSymbolInstance(symRef);
             li.Selected = (lstInstances.Items.Count == 1);
         }
 



More information about the mapguide-commits mailing list