/// <summary> /// Closes the attached drag window. /// </summary> private void CloseDragWindow() { if (dragWindow != null) { dragWindow.Close(); dragWindow.Dispose(); dragWindow = null; } }
/// <summary> /// Invokes the drag event and adjusts the size and location if a valid docking position was received. /// This method is only used by explicit drag windows (see flag). /// </summary> internal void MoveWindow() { dragTarget = SendDockEvent(false); if (dragTarget != null) { if (dragWindow == null) { dragWindow = new OverlayForm(); dragWindow.Size = dragTarget.Size; dragWindow.Show(); this.BringToFront(); } else { dragWindow.Size = dragTarget.Size; } if (dragTarget.Parent != null) { dragWindow.Location = dragTarget.RectangleToScreen(dragTarget.ClientRectangle).Location; } else { dragWindow.Location = dragTarget.Location; } } else if (DockManager.FastMoveDraw) { if (dragWindow == null) { dragWindow = new OverlayForm(); dragWindow.Size = this.Size; dragWindow.Show(); } else { dragWindow.Size = this.Size; } dragWindow.Location = this.Location; } else { CloseDragWindow(); } }
internal static void UpdateDockGuide(DockContainer target, DockEventArgs e) { if ((target == null) | noGuidePlease | (style != DockVisualStyle.VS2005) | fastMoveDraw) { HideDockGuide(); return; } if (dockGuide == null) { dockGuide = new OverlayForm(); } dockGuide.TargetHost = target; dockGuide.Size = target.Size; if (!dockGuide.Visible) { dockGuide.Show(); } if (target.Parent != null) { dockGuide.Location = target.RectangleToScreen(target.ClientRectangle).Location; } else { dockGuide.Location = target.Location; } dockGuide.BringToFront(); // Make tests. DockStyle dstStyle = dockGuide.HitTest(e.Point); if (dstStyle != DockStyle.None) { e.Point = target.GetVirtualDragDest(dstStyle); } else { e.Handled = true; } e.ShowDockGuide = true; }
/// <summary> /// Invokes the drag event and adjusts the size and location if a valid docking position was received. /// This method is only used by explicit drag windows (see flag). /// </summary> internal void MoveWindow() { dragTarget = SendDockEvent(false); if (dragTarget != null) { if (dragWindow == null) { dragWindow = new OverlayForm(); dragWindow.Size = dragTarget.Size; dragWindow.Show(); this.BringToFront(); } else dragWindow.Size = dragTarget.Size; if (dragTarget.Parent != null) dragWindow.Location = dragTarget.RectangleToScreen(dragTarget.ClientRectangle).Location; else dragWindow.Location = dragTarget.Location; } else if (DockManager.FastMoveDraw) { if (dragWindow == null) { dragWindow = new OverlayForm(); dragWindow.Size = this.Size; dragWindow.Show(); } else dragWindow.Size = this.Size; dragWindow.Location = this.Location; } else CloseDragWindow(); }
internal static void UpdateDockGuide(DockContainer target, DockEventArgs e) { if ((target == null) | noGuidePlease | (style != DockVisualStyle.VS2005) | fastMoveDraw) { HideDockGuide(); return; } if (dockGuide == null) dockGuide = new OverlayForm(); dockGuide.TargetHost = target; dockGuide.Size = target.Size; if (!dockGuide.Visible) dockGuide.Show(); if (target.Parent != null) dockGuide.Location = target.RectangleToScreen(target.ClientRectangle).Location; else dockGuide.Location = target.Location; dockGuide.BringToFront(); // Make tests. DockStyle dstStyle = dockGuide.HitTest(e.Point); if (dstStyle != DockStyle.None) e.Point = target.GetVirtualDragDest(dstStyle); else e.Handled = true; e.ShowDockGuide = true; }