[mapguide-commits] r5833 -
trunk/Tools/Maestro/Maestro.Editors/MapDefinition
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon May 23 08:55:40 EDT 2011
Author: jng
Date: 2011-05-23 05:55:40 -0700 (Mon, 23 May 2011)
New Revision: 5833
Modified:
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
Log:
#1631: Fix drag/drop to allow groups or layers to be moved up to the root level.
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2011-05-23 12:39:07 UTC (rev 5832)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2011-05-23 12:55:40 UTC (rev 5833)
@@ -762,34 +762,32 @@
parent = _map.GetGroupByName(li.Tag.Group);
}
- if (parent != null)
+ int moved = 0;
+ //Add to this group
+ foreach (var n in nodes)
{
- int moved = 0;
- //Add to this group
- foreach (var n in nodes)
- {
- var gi = n.Tag as GroupItem;
- var li = n.Tag as LayerItem;
+ var gi = n.Tag as GroupItem;
+ var li = n.Tag as LayerItem;
- //Re-assign parent
- if (gi != null)
- {
- gi.Tag.Group = parent.Name;
- moved++;
- }
- else if (li != null)
- {
- li.Tag.Group = parent.Name;
- moved++;
- }
+ //Re-assign parent
+ if (gi != null)
+ {
+ gi.Tag.Group = parent == null ? string.Empty : parent.Name;
+ moved++;
}
-
- if (moved > 0)
+ else if (li != null)
{
- //TODO: Fine-grain invalidation
- RefreshModels();
+ li.Tag.Group = parent == null ? string.Empty : parent.Name;
+ moved++;
}
}
+
+ if (moved > 0)
+ {
+ //TODO: Fine-grain invalidation
+ RefreshModels();
+ OnResourceChanged();
+ }
}
}
More information about the mapguide-commits
mailing list