示例#1
0
 public void Dispose()
 {
     if (_isDisposed)
     {
         return;
     }
     _isDisposed = true;
     DockManager?.RemoveDockControl(this);
     if (_protoType != null)
     {
         _protoType.PropertyChanged -= OnPrototypePropertyChanged;
         _protoType.Dispose();
         _protoType = null;
     }
 }
示例#2
0
        internal void OnMouseMove()
        {
            if (Keyboard.Modifiers == ModifierKeys.Control)
            {
                DockManager.LayoutRootPanel.RootGroupPanel?.HideDropWindow();
                DragTarget = null;
                return;
            }
            bool flag = false;

            _mouseP = DockHelper.GetMousePosition(DockManager);
            foreach (var wnd in DockManager.Windows.Where(w => w is BaseFloatWindow).Cast <BaseFloatWindow>())
            {
                if (wnd != _dragWnd &&
                    wnd.RestoreBounds.Contains(_mouseP) &&
                    !(wnd is DocumentGroupWindow && _dragItem.DragMode == DragMode.Anchor) &&
                    !(wnd is AnchorGroupWindow && _dragItem.DragMode == DragMode.Document))
                {
                    //if (wnd is DocumentGroupWindow)
                    //    if (DockManager.IsBehindToMainWindow(wnd))
                    //        continue;

                    var lflag = false;
                    if (!DockManager.IsAtWindowsIndex(wnd, 1))
                    {
                        //DockManager.MoveFloatTo(wnd);
                        lflag = true;
                    }
                    else if (DockManager.IsBehindToMainWindow(wnd))
                    {
                        lflag = true;
                    }

                    if (lflag)
                    {
                        Win32Helper.BringWindowToTop(wnd.Handle);
                        Win32Helper.BringWindowToTop(_dragWnd.Handle);
                        DockManager.UpdateWindowZOrder();
                    }

                    wnd.HitTest(_mouseP);

                    DockManager.LayoutRootPanel.RootGroupPanel.HideDropWindow();
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                var p = DockHelper.GetMousePositionRelativeTo(DockManager.LayoutRootPanel.RootGroupPanel);
                if (p.X >= 0 && p.Y >= 0 &&
                    p.X <= _rootSize.Width &&
                    p.Y <= _rootSize.Height)
                {
                    if (_dragItem.DragMode != DragMode.Document)
                    {
                        DockManager.LayoutRootPanel.RootGroupPanel?.ShowDropWindow();
                        DockManager.LayoutRootPanel.RootGroupPanel?.Update(_mouseP);
                    }
                    VisualTreeHelper.HitTest(DockManager.LayoutRootPanel.RootGroupPanel, _HitFilter, _HitRessult, new PointHitTestParameters(p));
                }
                else
                {
                    if (_dragItem.DragMode != DragMode.Document)
                    {
                        DockManager.LayoutRootPanel.RootGroupPanel?.HideDropWindow();
                    }
                    DragTarget = null;
                }
            }
        }
示例#3
0
 internal DragManager(DockManager dockManager)
 {
     _dockManager = dockManager;
 }
示例#4
0
        internal void OnMouseMove()
        {
            if (Keyboard.Modifiers == ModifierKeys.Control)
            {
                DockManager.LayoutRootPanel.RootGroupPanel?.HideDropWindow();
                DragTarget = null;
                return;
            }
            bool flag = false;

            _mouseP = DockHelper.GetMousePosition(DockManager);
            foreach (var wnd in DockManager.FloatWindows)
            {
                if (wnd != _dragWnd &&
                    wnd.RestoreBounds.Contains(_mouseP) &&
                    !(wnd is DocumentGroupWindow && _dragItem.DragMode == DragMode.Anchor) &&
                    !(wnd is AnchorGroupWindow && _dragItem.DragMode == DragMode.Document))
                {
                    if (wnd is DocumentGroupWindow)
                    {
                        if (DockManager.IsBehindToMainWindow(wnd))
                        {
                            continue;
                        }
                    }

                    if (wnd != DockManager.FloatWindows.First())
                    {
                        DockManager.MoveFloatTo(wnd);
                        Application.Current.Dispatcher.InvokeAsync(() =>
                        {
                            Win32Helper.BringWindowToTop(wnd.Handle);
                            Win32Helper.BringWindowToTop(_dragWnd.Handle);
                        }, DispatcherPriority.Background);
                    }
                    wnd.HitTest(_mouseP);

                    DockManager.LayoutRootPanel.RootGroupPanel.HideDropWindow();
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                var p = DockHelper.GetMousePositionRelativeTo(DockManager.LayoutRootPanel.RootGroupPanel);
                if (p.X >= 0 && p.Y >= 0 &&
                    p.X <= _rootSize.Width &&
                    p.Y <= _rootSize.Height)
                {
                    if (_dragItem.DragMode != DragMode.Document)
                    {
                        DockManager.LayoutRootPanel.RootGroupPanel?.ShowDropWindow();
                        DockManager.LayoutRootPanel.RootGroupPanel?.Update(_mouseP);
                    }
                    VisualTreeHelper.HitTest(DockManager.LayoutRootPanel.RootGroupPanel, _HitFilter, _HitRessult, new PointHitTestParameters(p));
                }
                else
                {
                    if (_dragItem.DragMode != DragMode.Document)
                    {
                        DockManager.LayoutRootPanel.RootGroupPanel?.HideDropWindow();
                    }
                    DragTarget = null;
                }
            }
        }