private void CloseDragWindow() { if (this.dragWindow != null) { this.dragWindow.Close(); this.dragWindow.Dispose(); this.dragWindow = null; } }
public DockForm(Panel dragObject) { this.dragWindow = null; this.dragTarget = null; this.rootContainer = null; this.moving = false; this.allowDock = true; this.components = null; this.InitializeComponent(); base.Opacity = 0.0; if (dragObject is DockContainer) { DockContainer container = dragObject as DockContainer; if (container.panList.Count == 1) { base.ClientSize = (container.panList[0] as DockPanel).Form.ClientSize; } else { base.ClientSize = dragObject.Size; } if (container.removeable) { this.rootContainer = container; } else { this.rootContainer = new DockContainer(); this.rootContainer.Controls.AddRange((DockPanel[])container.panList.ToArray(typeof(DockPanel))); this.rootContainer.Controls.AddRange((DockContainer[])container.conList.ToArray(typeof(DockContainer))); ArrayList list = new ArrayList(); this.rootContainer.GetPanels(list); if (list.Count > 0) { this.rootContainer.DockType = (list[0] as DockPanel).Form.DockType; } } } else if (dragObject is DockPanel) { DockPanel panel = dragObject as DockPanel; base.ClientSize = panel.Form.ClientSize; this.rootContainer = new DockContainer(); panel.Form.CopyToDockForm(this); } if (this.rootContainer.IsPanelContainer) { (this.rootContainer.panList[0] as DockPanel).Form.CopyPropToDockForm(this); this.rootContainer.SetFormSizeBounds(this); this.rootContainer.SelectTab(0); } this.rootContainer.Dock = DockStyle.Fill; base.Controls.Add(this.rootContainer); this.RegisterToMdiContainer(); }
public DockForm() { this.dragWindow = null; this.dragTarget = null; this.rootContainer = null; this.moving = false; this.allowDock = true; this.components = null; this.InitializeComponent(); this.rootContainer = new DockContainer(); this.rootContainer.Dock = DockStyle.Fill; base.Controls.Add(this.rootContainer); this.RegisterToMdiContainer(); }
internal static void UpdateDockGuide(DockContainer target, DockEventArgs e) { if ((((target == null) | noGuidePlease) | (DockManager.style != DockVisualStyle.VS2005)) | fastMoveDraw) { HideDockGuide(); } else { if (dockGuide == null) { dockGuide = new OverlayForm(); } Size size = dockGuide.Size; Point location = dockGuide.Location; 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; } if ((dockGuide.Location != location) || (dockGuide.Size != size)) { dockGuide.Invalidate(); } dockGuide.BringToFront(); DockStyle style = dockGuide.HitTest(e.Point); if (style != DockStyle.None) { e.Point = target.GetVirtualDragDest(style); } else { e.Handled = true; } e.ShowDockGuide = true; } }
internal void MoveWindow() { this.dragTarget = this.SendDockEvent(false); if (this.dragTarget != null) { if (this.dragWindow == null) { this.dragWindow = new OverlayForm(); this.dragWindow.Size = this.dragTarget.Size; this.dragWindow.Show(); base.BringToFront(); } else { this.dragWindow.Size = this.dragTarget.Size; } if (this.dragTarget.Parent != null) { this.dragWindow.Location = this.dragTarget.RectangleToScreen(this.dragTarget.ClientRectangle).Location; } else { this.dragWindow.Location = this.dragTarget.Location; } } else if (DockManager.FastMoveDraw) { if (this.dragWindow == null) { this.dragWindow = new OverlayForm(); this.dragWindow.Size = base.Size; this.dragWindow.Show(); } else { this.dragWindow.Size = base.Size; } this.dragWindow.Location = base.Location; } else { this.CloseDragWindow(); } }