Ejemplo n.º 1
0
        private void TestDrop()
        {
            DockOutline.FlagTestDrop = false;

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

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

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

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

            if (!DockOutline.FlagTestDrop)
            {
                if (IsDockStateValid(DockState.Float))
                {
                    DockOutline.Show(GetFloatWindowBounds());
                }
            }

            if (!DockOutline.FlagTestDrop)
            {
                User32.SetCursor(Cursors.No.Handle);
                DockOutline.Show();
            }
            else
            {
                User32.SetCursor(DragControl.Cursor.Handle);
            }
        }
Ejemplo n.º 2
0
        protected override void OnEndDrag(bool abort)
        {
            if (Source == DragSource.Content ||
                Source == DragSource.Pane ||
                Source == DragSource.FloatWindow)
            {
                DockOutline.Close();
                DockIndicator.Close();
            }
            else if (Source == DragSource.AutoHideWindowSplitter ||
                     Source == DragSource.DockWindowSplitter ||
                     Source == DragSource.PaneSplitter)
            {
                SplitterOutline.Close();
            }

            if (Source == DragSource.Content)
            {
                Content_OnEndDrag(abort);
            }
            else if (Source == DragSource.Pane)
            {
                Pane_OnEndDrag(abort);
            }
            else if (Source == DragSource.PaneSplitter)
            {
                PaneSplitter_OnEndDrag(abort);
            }
            else if (Source == DragSource.DockWindowSplitter)
            {
                DockWindowSplitter_OnEndDrag(abort);
            }
            else if (Source == DragSource.AutoHideWindowSplitter)
            {
                AutoHideWindowSplitter_OnEndDrag(abort);
            }
            else if (Source == DragSource.FloatWindow)
            {
                FloatWindow_OnEndDrag(abort);
            }
        }