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));
}
}