ComponentFactory.Krypton.Docking.KryptonDockingManager.DoDragDrop C# (CSharp) Method

DoDragDrop() public method

Generate an implementation of the IDragPageNotify class that will be used to handle the drag/drop operation.
public DoDragDrop ( Point screenPoint, Point elementOffset, Control c, KryptonDockingFloatingWindow window ) : void
screenPoint Point Screen point of the mouse for the drag operation.
elementOffset Point Offset from top left of element causing the drag.
c Control Control that started the drag operation.
window KryptonDockingFloatingWindow Reference to floating window element that should be dragged.
return void
        public virtual void DoDragDrop(Point screenPoint, Point elementOffset, Control c, KryptonDockingFloatingWindow window)
        {
            // Cannot drag a null reference
            if (window == null)
                throw new ArgumentNullException("window");

            // Create a list of all the visible pages inside the floating window
            KryptonPageCollection pages = new KryptonPageCollection();
            KryptonWorkspaceCell cell = window.FloatspaceElement.FloatspaceControl.FirstVisibleCell();
            while (cell != null)
            {
                foreach (KryptonPage page in cell.Pages)
                    if (!(page is KryptonStorePage) && page.LastVisibleSet)
                        pages.Add(page);

                cell = window.FloatspaceElement.FloatspaceControl.NextVisibleCell(cell);
            }

            // If it actually has any visible contents to be moved
            if (pages.Count > 0)
            {
                // Create docking specific drag manager for moving the pages around
                DockingDragManager dragManager = new DockingDragManager(this, null);
                dragManager.FloatingWindow = window.FloatingWindow;
                dragManager.FloatingWindowOffset = elementOffset;

                // Set the window location before it is shown otherwise we see a brief flash as it appears at the
                // existing location and then it moves to the correct location based on the screen mouse position
                dragManager.FloatingWindow.Location = new Point(screenPoint.X - elementOffset.X, screenPoint.Y - elementOffset.Y);

                // Add ourself as a source of drag targets and then begin the dragging process
                dragManager.DragTargetProviders.Add(new DockingDragTargetProvider(this, dragManager.FloatingWindow, pages));
                dragManager.DragStart(screenPoint, new PageDragEndData(this, pages));
            }
        }

Same methods

KryptonDockingManager::DoDragDrop ( Point screenPoint, Point elementOffset, Control c, KryptonPageCollection pages ) : void
KryptonDockingManager