public bool IsTargetNearSource(DragQueryResult targetBlock) { if (ShouldCopyInsteadOfMove) { return(false); } Block target = targetBlock.DropTarget; foreach (Block dragged in this) { if (target == dragged) { return(true); } if (target == dragged.Next || target == dragged.Prev) { if (target is ISeparatorBlock) { return(true); } else { if (target == dragged.Next && targetBlock.HowToDrop == DropTargetInfo.DropBeforeTarget) { return(true); } if (target == dragged.Prev && targetBlock.HowToDrop != DropTargetInfo.DropBeforeTarget) { return(true); } } } } return(false); }
public bool CanDropHere(DragQueryResult potentialDropPoint) { return (potentialDropPoint.DropTargetValid && !IsTargetNearSource(potentialDropPoint)); }