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;
        }
Exemple #2
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;
     }
 }