Пример #1
0
            public ShowAsTabbedEventArgs(DockItem dockItem, DockPane pane, int index, DockItemShowMethod showMethod)
                : base(dockItem, pane.DockControl, showMethod)
            {
                ShowAsTabbedAction showAction     = StrongTypeShowAction;
                DockPaneNodeStruct paneNodeStruct = DockPaneNodeStruct.FromDockPaneNode(pane);

                showAction.Target     = paneNodeStruct.ItemIndex;
                showAction.IsFloating = paneNodeStruct.IsFloating;
                showAction.Index      = index;
            }
            public ShowAsSidePaneEventArgs(DockItem dockItem, DockPaneNode paneNode, bool isAutoHide, Dock side, SplitterDistance size, bool isSizeForTarget, DockItemShowMethod showMethod)
                : base(dockItem, paneNode.DockControl, showMethod)
            {
                ShowAsSidePaneAction showAction     = StrongTypeShowAction;
                DockPaneNodeStruct   paneNodeStruct = DockPaneNodeStruct.FromDockPaneNode(paneNode);

                showAction.Target          = paneNodeStruct.ItemIndex;
                showAction.IsFloating      = paneNodeStruct.IsFloating;
                showAction.AncestorLevel   = paneNodeStruct.AncestorLevel;
                showAction.IsAutoHide      = isAutoHide;
                showAction.Side            = side;
                showAction.Size            = size;
                showAction.IsSizeForTarget = isSizeForTarget;
            }
Пример #3
0
            private static ShowAction GetShowAsSidePaneAction(DockItem item, DockPane pane)
            {
                DockPaneSplit split = pane.Parent;

                Debug.Assert(split != null);
                DockPaneNode targetPaneNode = split.Child1 == pane ? split.Child2 : split.Child1;

                Debug.Assert(targetPaneNode != null);
                DockPaneNodeStruct targetPaneNodeStruct = DockPaneNodeStruct.FromDockPaneNode(targetPaneNode);
                bool swapChildren = split.Child1 == targetPaneNode;
                Dock side;

                if (split.Orientation == Orientation.Horizontal)
                {
                    if (split.IsSplitterTopLeft)
                    {
                        side = Dock.Left;
                    }
                    else
                    {
                        side = Dock.Right;
                    }
                }
                else
                {
                    if (split.IsSplitterTopLeft)
                    {
                        side = Dock.Top;
                    }
                    else
                    {
                        side = Dock.Bottom;
                    }
                }
                SplitterDistance splitterDistance = split.SplitterDistance;

                int  source                   = pane.DockControl.DockItems.IndexOf(item);
                int  targetIndex              = targetPaneNodeStruct.ItemIndex;
                bool isFloating               = targetPaneNodeStruct.IsFloating;
                int  ancestorLevel            = targetPaneNodeStruct.AncestorLevel;
                bool isAutoHide               = pane.IsAutoHide;
                DockItemShowMethod showMethod = GetShowMethod(item, pane);

                return(new ShowAsSidePaneAction(source, targetIndex, isFloating, ancestorLevel, isAutoHide, side, splitterDistance, swapChildren, showMethod));
            }