예제 #1
0
 private void CloseDragWindow()
 {
     if (this.dragWindow != null)
     {
         this.dragWindow.Close();
         this.dragWindow.Dispose();
         this.dragWindow = null;
     }
 }
예제 #2
0
 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();
 }
예제 #3
0
 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();
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 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();
     }
 }