src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeControl.cs
/// <summary>
///     Helper fucntion for OnQueryContinueDrag. Allows us to reprocess
///     previously processed items if the DragAction changes.
/// </summary>
/// <param name="args">QueryContinueDragEventArgs</param>
/// <param name="sources">The sources being changed</param>
/// <param name="count">The count of items to process. May be less than sources.Count</param>
Helper fucntion for OnQueryContinueDrag. Allows us to reprocess
previously processed items if the DragAction changes.
Helper fucntion for OnQueryContinueDrag . Allows us to reprocess previously processed items if the DragAction changes .
private static void ProcessMultipleOnQueryContinueDrag(QueryContinueDragEventArgs args, List<DragSourceOwner> sources, int count)
        {
            var lastAction = args.Action;
            for (var i = 0; i < count; ++i)
            {
                sources[i].OnQueryContinueDrag(args);
                if (args.Action != lastAction)
                {
                    switch (lastAction)
                    {
                        case DragAction.Cancel:
                            args.Action = DragAction.Cancel;
                            break;
                        case DragAction.Drop:
                            switch (args.Action)
                            {
                                case DragAction.Cancel:
                                    break;
                                case DragAction.Continue:
                                    args.Action = DragAction.Drop;
                                    break;
                            }
                            break;
                        case DragAction.Continue:
                            if (i > 0)
                            {
                                ProcessMultipleOnQueryContinueDrag(args, sources, i - 1);
                            }
                            break;
                    }
                }
            }
        }
private static void ProcessMultipleOnQueryContinueDrag ( QueryContinueDragEventArgs args , List < DragSourceOwner > sources , int count ) { var lastAction = args . Action ; for ( var i = 0 ; i < count ; ++ i ) { sources [ i ] . OnQueryContinueDrag ( args ) ; if ( args . Action != lastAction ) { switch ( lastAction ) { case DragAction . Cancel : args . Action = DragAction . Cancel ; break ; case DragAction . Drop : switch ( args . Action ) { case DragAction . Cancel : break ; case DragAction . Continue : args . Action = DragAction . Drop ; break ; } break ; case DragAction . Continue : if ( i > 0 ) { ProcessMultipleOnQueryContinueDrag ( args , sources , i - 1 ) ; } break ; } } } }
Helper fucntion for OnQueryContinueDrag.
Helper fucntion for OnQueryContinueDrag .
// Ignore, can't abort a cancel // Nothing can be done here for the previous items. You // can't cancel a drop after the drop has been notified. // Ignore, if the user ignores a Cancel or Drop and // changes the DragAction they get what they deserve, // but don't affect the other objects. // Process back from the beginning with the new drag or cancel action
args
QueryContinueDragEventArgs
None
sources
List<DragSourceOwner>
The sources being changed
The sources being changed
count
int
The count of items to process. May be less than sources.Count
The count of items to process . May be less than sources . Count