WeifenLuo.WinFormsUI.Docking.FloatWindow.TestDrop C# (CSharp) Method

TestDrop() private method

private TestDrop ( IDockDragSource dragSource, DockOutlineBase dockOutline ) : void
dragSource IDockDragSource
dockOutline DockOutlineBase
return void
        internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
        {
            if (VisibleNestedPanes.Count == 1)
            {
                DockPane pane = VisibleNestedPanes[0];
                if (!dragSource.CanDockTo(pane))
                    return;

                Point ptMouse = Control.MousePosition;
                uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
                if (!Win32Helper.IsRunningOnMono)
                {
                    if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
                    {
                        dockOutline.Show(VisibleNestedPanes[0], -1);
                    }
                }
            }
        }

Usage Example

            private void TestDrop()
            {
                if (Outline == null || Indicator == null || Indicator.IsDisposed)
                {
                    return;
                }

                Outline.FlagTestDrop = false;

                Indicator.FullPanelEdge = ((Control.ModifierKeys & Keys.Shift) != 0);

                if ((Control.ModifierKeys & Keys.Control) == 0)
                {
                    Indicator.TestDrop();

                    if (!Outline.FlagTestDrop)
                    {
                        DockPane pane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
                        if (pane != null && DragSource.IsDockStateValid(pane.DockState))
                        {
                            pane.TestDrop(DragSource, Outline);
                        }
                    }

                    if (!Outline.FlagTestDrop && DragSource.IsDockStateValid(DockState.Float))
                    {
                        FloatWindow floatWindow = DockHelper.FloatWindowAtPoint(Control.MousePosition, DockPanel);
                        if (floatWindow != null)
                        {
                            floatWindow.TestDrop(DragSource, Outline);
                        }
                    }
                }
                else
                {
                    Indicator.DockPane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
                }

                if (!Outline.FlagTestDrop)
                {
                    if (DragSource.IsDockStateValid(DockState.Float))
                    {
                        Rectangle rect = FloatOutlineBounds;
                        rect.Offset(Control.MousePosition.X - StartMousePosition.X, Control.MousePosition.Y - StartMousePosition.Y);
                        Outline.Show(rect);
                    }
                }

                if (!Outline.FlagTestDrop)
                {
                    Cursor.Current = Cursors.No;
                    Outline.Show();
                }
                else
                {
                    Cursor.Current = DragControl.Cursor;
                }
            }
All Usage Examples Of WeifenLuo.WinFormsUI.Docking.FloatWindow::TestDrop