[mapguide-commits] r7058 - trunk/Tools/Maestro/Maestro.Editors/MapDefinition

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 1 06:54:36 PDT 2012


Author: jng
Date: 2012-10-01 06:54:36 -0700 (Mon, 01 Oct 2012)
New Revision: 7058

Modified:
   trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
Log:
#2115: Prevent group drops to directly underneath the original source (source == target, in such cases)

Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs	2012-10-01 13:37:48 UTC (rev 7057)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs	2012-10-01 13:54:36 UTC (rev 7058)
@@ -1044,7 +1044,7 @@
                     var li = node.Tag as LayerItem;
                     if (gi != null)
                     {
-                        if (TargetIsDescendant(nodes, gi))
+                        if (TargetIsAmongSource(nodes, gi) || TargetIsDescendant(nodes, gi))
                             return;
 
                         parent = gi.Tag;
@@ -1087,6 +1087,17 @@
             }
         }
 
+        private static bool TargetIsAmongSource(TreeNodeAdv[] nodes, GroupItem target)
+        {
+            foreach (var n in nodes)
+            {
+                var gi = n.Tag as GroupItem;
+                if (gi != null && gi == target)
+                    return true;
+            }
+            return false;
+        }
+
         private bool TargetIsDescendant(TreeNodeAdv[] nodes, GroupItem target)
         {
             foreach (var n in nodes)



More information about the mapguide-commits mailing list