/// <summary> /// Called to initialize the implementation when dragging starts. /// </summary> /// <param name="paletteDragDrop">Drawing palette.</param> /// <param name="renderer">Drawing renderer.</param> /// <param name="pageDragEndData">Drag data associated with drag operation.</param> /// <param name="dragTargets">List of all drag targets.</param> public override void Start(IPaletteDragDrop paletteDragDrop, IRenderer renderer, PageDragEndData pageDragEndData, DragTargetList dragTargets) { base.Start(paletteDragDrop, renderer, pageDragEndData, dragTargets); if (_solid == null) { // Create and show a window without it taking focus _solid = new DropSolidWindow(PaletteDragDrop, Renderer); _solid.SetBounds(0, 0, 1, 1, BoundsSpecified.All); _solid.ShowWithoutActivate(); _solid.Refresh(); } }
/// <summary> /// Called to initialize the implementation when dragging starts. /// </summary> /// <param name="paletteDragDrop">Drawing palette.</param> /// <param name="renderer">Drawing renderer.</param> /// <param name="pageDragEndData">Drag data associated with drag operation.</param> /// <param name="dragTargets">List of all drag targets.</param> public override void Start(IPaletteDragDrop paletteDragDrop, IRenderer renderer, PageDragEndData pageDragEndData, DragTargetList dragTargets) { base.Start(paletteDragDrop, renderer, pageDragEndData, dragTargets); if (_solid == null) { // Create and show a solid feedback window without it taking focus _solid = new DropSolidWindow(PaletteDragDrop, Renderer); _solid.SetBounds(0, 0, 1, 1, BoundsSpecified.All); _solid.ShowWithoutActivate(); _solid.Refresh(); } ClearClusters(); // Create clusters of related drag targets foreach (DragTarget target in dragTargets) { // Check if the target is actually able to drop inside itself if (target.IsMatch(target.HotRect.Location, pageDragEndData)) { // Find the existing cluster for the targets screen rectangle DockCluster cluster = FindTargetCluster(target); // Is the target allowed to be added to the found cluster (if there is one found) if ((cluster == null) || cluster.ExcludeCluster || ((target.Hint & DragTargetHint.ExcludeCluster) == DragTargetHint.ExcludeCluster)) { _clusters.Add(new DockCluster(PaletteDragDrop, Renderer, target)); } else { cluster.Add(target); } } } }