Beispiel #1
0
 /// <summary>
 /// 获取一个布局可抛锚窗格
 /// </summary>
 /// <param name="Title">标题</param>
 /// <param name="FatherLayout">父布局</param>
 /// <returns></returns>
 public LayoutAnchorable AddLayoutAnchorablePane(LayoutAnchorablePaneGroup FatherLayout, string Title = "属性")
 {
     try
     {
         LayoutAnchorablePane pane       = new LayoutAnchorablePane();
         LayoutAnchorable     anchorable = new LayoutAnchorable();
         anchorable.Title = Title;
         pane.Children.Add(anchorable);
         FatherLayout.Children.Add(pane);
         return(anchorable);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "[MainWindow][miAnchorVerticalPane_Click_1]");
         return(null);
     }
 }
Beispiel #2
0
        private LayoutAnchorablePaneGroup GetLeftLayoutAnchorablePaneGroup()
        {
            var layoutAnchorablePaneGroup = new LayoutAnchorablePaneGroup()
            {
                DockMinWidth  = 200,
                FloatingWidth = 200
            };
            LayoutAnchorablePane layoutAnchorablePane = new LayoutAnchorablePane();
            LayoutAnchorable     layoutAnchorable     = new LayoutAnchorable()
            {
                Title   = "图例",
                CanHide = false
            };

            layoutAnchorablePane.Children.Add(layoutAnchorable);
            layoutAnchorablePaneGroup.Children.Add(layoutAnchorablePane);
            return(layoutAnchorablePaneGroup);
        }
        protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)
        {
            ILayoutAnchorablePane targetModel      = _targetPane.Model as ILayoutAnchorablePane;
            LayoutAnchorable      anchorableActive = floatingWindow.Descendents().OfType <LayoutAnchorable>().FirstOrDefault();

            switch (Type)
            {
            case DropTargetType.AnchorablePaneDockBottom:
                #region DropTargetType.AnchorablePaneDockBottom
            {
                var parentModel           = targetModel.Parent as ILayoutGroup;
                var parentModelOrientable = targetModel.Parent as ILayoutOrientableGroup;
                int insertToIndex         = parentModel.IndexOfChild(targetModel);

                if (parentModelOrientable.Orientation != System.Windows.Controls.Orientation.Vertical &&
                    parentModel.ChildrenCount == 1)
                {
                    parentModelOrientable.Orientation = System.Windows.Controls.Orientation.Vertical;
                }

                if (parentModelOrientable.Orientation == System.Windows.Controls.Orientation.Vertical)
                {
                    var layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        (layoutAnchorablePaneGroup.Children.Count == 1 ||
                         layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Vertical))
                    {
                        var anchorablesToMove = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < anchorablesToMove.Length; i++)
                        {
                            parentModel.InsertChildAt(insertToIndex + 1 + i, anchorablesToMove[i]);
                        }
                    }
                    else
                    {
                        parentModel.InsertChildAt(insertToIndex + 1, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var targetModelAsPositionableElement = targetModel as ILayoutPositionableElement;
                    var newOrientedPanel = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = System.Windows.Controls.Orientation.Vertical,
                        DockWidth   = targetModelAsPositionableElement.DockWidth,
                        DockHeight  = targetModelAsPositionableElement.DockHeight,
                    };

                    parentModel.InsertChildAt(insertToIndex, newOrientedPanel);
                    newOrientedPanel.Children.Add(targetModel);
                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);
                }
            }
            break;

                #endregion
            case DropTargetType.AnchorablePaneDockTop:
                #region DropTargetType.AnchorablePaneDockTop
            {
                var parentModel           = targetModel.Parent as ILayoutGroup;
                var parentModelOrientable = targetModel.Parent as ILayoutOrientableGroup;
                int insertToIndex         = parentModel.IndexOfChild(targetModel);

                if (parentModelOrientable.Orientation != System.Windows.Controls.Orientation.Vertical &&
                    parentModel.ChildrenCount == 1)
                {
                    parentModelOrientable.Orientation = System.Windows.Controls.Orientation.Vertical;
                }

                if (parentModelOrientable.Orientation == System.Windows.Controls.Orientation.Vertical)
                {
                    var layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        (layoutAnchorablePaneGroup.Children.Count == 1 ||
                         layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Vertical))
                    {
                        var anchorablesToMove = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < anchorablesToMove.Length; i++)
                        {
                            parentModel.InsertChildAt(insertToIndex + i, anchorablesToMove[i]);
                        }
                    }
                    else
                    {
                        parentModel.InsertChildAt(insertToIndex, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var targetModelAsPositionableElement = targetModel as ILayoutPositionableElement;
                    var newOrientedPanel = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = System.Windows.Controls.Orientation.Vertical,
                        DockWidth   = targetModelAsPositionableElement.DockWidth,
                        DockHeight  = targetModelAsPositionableElement.DockHeight,
                    };

                    parentModel.InsertChildAt(insertToIndex, newOrientedPanel);
                    //the floating window must be added after the target modal as it could be raise a CollectGarbage call
                    newOrientedPanel.Children.Add(targetModel);
                    newOrientedPanel.Children.Insert(0, floatingWindow.RootPanel);
                }
            }
            break;

                #endregion
            case DropTargetType.AnchorablePaneDockLeft:
                #region DropTargetType.AnchorablePaneDockLeft
            {
                var parentModel           = targetModel.Parent as ILayoutGroup;
                var parentModelOrientable = targetModel.Parent as ILayoutOrientableGroup;
                int insertToIndex         = parentModel.IndexOfChild(targetModel);

                if (parentModelOrientable.Orientation != System.Windows.Controls.Orientation.Horizontal &&
                    parentModel.ChildrenCount == 1)
                {
                    parentModelOrientable.Orientation = System.Windows.Controls.Orientation.Horizontal;
                }

                if (parentModelOrientable.Orientation == System.Windows.Controls.Orientation.Horizontal)
                {
                    var layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        (layoutAnchorablePaneGroup.Children.Count == 1 ||
                         layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Horizontal))
                    {
                        var anchorablesToMove = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < anchorablesToMove.Length; i++)
                        {
                            parentModel.InsertChildAt(insertToIndex + i, anchorablesToMove[i]);
                        }
                    }
                    else
                    {
                        parentModel.InsertChildAt(insertToIndex, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var targetModelAsPositionableElement = targetModel as ILayoutPositionableElement;
                    var newOrientedPanel = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = System.Windows.Controls.Orientation.Horizontal,
                        DockWidth   = targetModelAsPositionableElement.DockWidth,
                        DockHeight  = targetModelAsPositionableElement.DockHeight,
                    };

                    parentModel.InsertChildAt(insertToIndex, newOrientedPanel);
                    //the floating window must be added after the target modal as it could be raise a CollectGarbage call
                    newOrientedPanel.Children.Add(targetModel);
                    newOrientedPanel.Children.Insert(0, floatingWindow.RootPanel);
                }
            }
            break;

                #endregion
            case DropTargetType.AnchorablePaneDockRight:
                #region DropTargetType.AnchorablePaneDockRight
            {
                var parentModel           = targetModel.Parent as ILayoutGroup;
                var parentModelOrientable = targetModel.Parent as ILayoutOrientableGroup;
                int insertToIndex         = parentModel.IndexOfChild(targetModel);

                if (parentModelOrientable.Orientation != System.Windows.Controls.Orientation.Horizontal &&
                    parentModel.ChildrenCount == 1)
                {
                    parentModelOrientable.Orientation = System.Windows.Controls.Orientation.Horizontal;
                }

                if (parentModelOrientable.Orientation == System.Windows.Controls.Orientation.Horizontal)
                {
                    var layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        (layoutAnchorablePaneGroup.Children.Count == 1 ||
                         layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Horizontal))
                    {
                        var anchorablesToMove = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < anchorablesToMove.Length; i++)
                        {
                            parentModel.InsertChildAt(insertToIndex + 1 + i, anchorablesToMove[i]);
                        }
                    }
                    else
                    {
                        parentModel.InsertChildAt(insertToIndex + 1, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var targetModelAsPositionableElement = targetModel as ILayoutPositionableElement;
                    var newOrientedPanel = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = System.Windows.Controls.Orientation.Horizontal,
                        DockWidth   = targetModelAsPositionableElement.DockWidth,
                        DockHeight  = targetModelAsPositionableElement.DockHeight,
                    };

                    parentModel.InsertChildAt(insertToIndex, newOrientedPanel);
                    newOrientedPanel.Children.Add(targetModel);
                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);
                }
            }
            break;
                #endregion


            case DropTargetType.AnchorablePaneDockInside:
                #region DropTargetType.AnchorablePaneDockInside
            {
                var paneModel = targetModel as LayoutAnchorablePane;
                var layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;

                int i = _tabIndex == -1 ? 0 : _tabIndex;
                foreach (var anchorableToImport in
                         layoutAnchorablePaneGroup.Descendents().OfType <LayoutAnchorable>().ToArray())
                {
                    paneModel.Children.Insert(i, anchorableToImport);
                    i++;
                }
            }
            break;
                #endregion
            }

            anchorableActive.IsActive = true;

            base.Drop(floatingWindow);
        }
Beispiel #4
0
 internal LayoutAnchorablePaneGroupControl(LayoutAnchorablePaneGroup model)
     : base(model, model.Orientation)
 {
     _model = model;
 }
        protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)
        {
            ILayoutAnchorablePane[]   childrenToTransfer        = new ILayoutAnchorablePane[0];
            LayoutAnchorablePaneGroup layoutAnchorablePaneGroup = (LayoutAnchorablePaneGroup)(floatingWindow.RootPanel);

            if (layoutAnchorablePaneGroup != null)
            {
                childrenToTransfer = layoutAnchorablePaneGroup.Children.ToArray();
            }
            switch (Type)
            {
            case DropTargetType.DockingManagerDockLeft:
                #region DropTargetType.DockingManagerDockLeft
            {
                if (_manager.Layout.RootPanel.Orientation != System.Windows.Controls.Orientation.Horizontal &&
                    _manager.Layout.RootPanel.Children.Count == 1)
                {
                    _manager.Layout.RootPanel.Orientation = System.Windows.Controls.Orientation.Horizontal;
                }

                if (_manager.Layout.RootPanel.Orientation == System.Windows.Controls.Orientation.Horizontal)
                {
                    //layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Horizontal)
                    {
                        //childrenToTransfer = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < childrenToTransfer.Length; i++)
                        {
                            _manager.Layout.RootPanel.Children.Insert(i, childrenToTransfer[i]);
                        }
                    }
                    else
                    {
                        _manager.Layout.RootPanel.Children.Insert(0, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var newOrientedPanel = new LayoutPanel()
                    {
                        Orientation = System.Windows.Controls.Orientation.Horizontal
                    };

                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);
                    newOrientedPanel.Children.Add(_manager.Layout.RootPanel);

                    _manager.Layout.RootPanel = newOrientedPanel;
                }
            }
            break;

                #endregion
            case DropTargetType.DockingManagerDockRight:
                #region DropTargetType.DockingManagerDockRight
            {
                if (_manager.Layout.RootPanel.Orientation != System.Windows.Controls.Orientation.Horizontal &&
                    _manager.Layout.RootPanel.Children.Count == 1)
                {
                    _manager.Layout.RootPanel.Orientation = System.Windows.Controls.Orientation.Horizontal;
                }

                if (_manager.Layout.RootPanel.Orientation == System.Windows.Controls.Orientation.Horizontal)
                {
                    //layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Horizontal)
                    {
                        //childrenToTransfer = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < childrenToTransfer.Length; i++)
                        {
                            _manager.Layout.RootPanel.Children.Add(childrenToTransfer[i]);
                        }
                    }
                    else
                    {
                        _manager.Layout.RootPanel.Children.Add(floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var newOrientedPanel = new LayoutPanel()
                    {
                        Orientation = System.Windows.Controls.Orientation.Horizontal
                    };

                    newOrientedPanel.Children.Add(_manager.Layout.RootPanel);
                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);

                    _manager.Layout.RootPanel = newOrientedPanel;
                }
            }
            break;

                #endregion
            case DropTargetType.DockingManagerDockTop:
                #region DropTargetType.DockingManagerDockTop
            {
                if (_manager.Layout.RootPanel.Orientation != System.Windows.Controls.Orientation.Vertical &&
                    _manager.Layout.RootPanel.Children.Count == 1)
                {
                    _manager.Layout.RootPanel.Orientation = System.Windows.Controls.Orientation.Vertical;
                }

                if (_manager.Layout.RootPanel.Orientation == System.Windows.Controls.Orientation.Vertical)
                {
                    //layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Vertical)
                    {
                        //childrenToTransfer = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < childrenToTransfer.Length; i++)
                        {
                            _manager.Layout.RootPanel.Children.Insert(i, childrenToTransfer[i]);
                        }
                    }
                    else
                    {
                        _manager.Layout.RootPanel.Children.Insert(0, floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var newOrientedPanel = new LayoutPanel()
                    {
                        Orientation = System.Windows.Controls.Orientation.Vertical
                    };

                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);
                    newOrientedPanel.Children.Add(_manager.Layout.RootPanel);

                    _manager.Layout.RootPanel = newOrientedPanel;
                }
            }
            break;

                #endregion
            case DropTargetType.DockingManagerDockBottom:
                #region DropTargetType.DockingManagerDockBottom
            {
                if (_manager.Layout.RootPanel.Orientation != System.Windows.Controls.Orientation.Vertical &&
                    _manager.Layout.RootPanel.Children.Count == 1)
                {
                    _manager.Layout.RootPanel.Orientation = System.Windows.Controls.Orientation.Vertical;
                }

                if (_manager.Layout.RootPanel.Orientation == System.Windows.Controls.Orientation.Vertical)
                {
                    //layoutAnchorablePaneGroup = floatingWindow.RootPanel as LayoutAnchorablePaneGroup;
                    if (layoutAnchorablePaneGroup != null &&
                        layoutAnchorablePaneGroup.Orientation == System.Windows.Controls.Orientation.Vertical)
                    {
                        //childrenToTransfer = layoutAnchorablePaneGroup.Children.ToArray();
                        for (int i = 0; i < childrenToTransfer.Length; i++)
                        {
                            _manager.Layout.RootPanel.Children.Add(childrenToTransfer[i]);
                        }
                    }
                    else
                    {
                        _manager.Layout.RootPanel.Children.Add(floatingWindow.RootPanel);
                    }
                }
                else
                {
                    var newOrientedPanel = new LayoutPanel()
                    {
                        Orientation = System.Windows.Controls.Orientation.Vertical
                    };

                    newOrientedPanel.Children.Add(_manager.Layout.RootPanel);
                    newOrientedPanel.Children.Add(floatingWindow.RootPanel);

                    _manager.Layout.RootPanel = newOrientedPanel;
                }
            }
            break;
                #endregion
            }
            foreach (LayoutAnchorablePane lapane in childrenToTransfer)
            {
                //LayoutAnchorablePane lapane = (LayoutAnchorablePane)ilapane;
                foreach (LayoutAnchorable lanch in lapane.Children)
                {
                    lanch.IsDock = true;
                    switch (Type)
                    {
                    case DropTargetType.DockingManagerDockLeft:
                        Global.LayoutSetting.AddDefaultSideAnchorable(
                            lanch.Title, "LEFT");
                        break;

                    case DropTargetType.DockingManagerDockRight:
                        Global.LayoutSetting.AddDefaultSideAnchorable(
                            lanch.Title, "RIGHT");
                        break;

                    case DropTargetType.DockingManagerDockTop:
                        Global.LayoutSetting.AddDefaultSideAnchorable(
                            lanch.Title, "TOP");
                        break;

                    case DropTargetType.DockingManagerDockBottom:
                        Global.LayoutSetting.AddDefaultSideAnchorable(
                            lanch.Title, "DOWN");
                        break;
                    }
                }
            }
            base.Drop(floatingWindow);
        }
Beispiel #6
0
        protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)
        {
            switch (base.Type)
            {
            case DropTargetType.DockingManagerDockLeft:
            {
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Horizontal && this._manager.Layout.RootPanel.Children.Count == 1)
                {
                    this._manager.Layout.RootPanel.Orientation = Orientation.Horizontal;
                }
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Horizontal)
                {
                    LayoutPanel layoutPanel = new LayoutPanel()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    layoutPanel.Children.Add(floatingWindow.RootPanel);
                    layoutPanel.Children.Add(this._manager.Layout.RootPanel);
                    this._manager.Layout.RootPanel = layoutPanel;
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel = floatingWindow.RootPanel;
                    if (rootPanel == null || rootPanel.Orientation != Orientation.Horizontal)
                    {
                        this._manager.Layout.RootPanel.Children.Insert(0, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] array = rootPanel.Children.ToArray <ILayoutAnchorablePane>();
                        for (int i = 0; i < (int)array.Length; i++)
                        {
                            this._manager.Layout.RootPanel.Children.Insert(i, array[i]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.DockingManagerDockTop:
            {
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Vertical && this._manager.Layout.RootPanel.Children.Count == 1)
                {
                    this._manager.Layout.RootPanel.Orientation = Orientation.Vertical;
                }
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Vertical)
                {
                    LayoutPanel layoutPanel1 = new LayoutPanel()
                    {
                        Orientation = Orientation.Vertical
                    };
                    layoutPanel1.Children.Add(floatingWindow.RootPanel);
                    layoutPanel1.Children.Add(this._manager.Layout.RootPanel);
                    this._manager.Layout.RootPanel = layoutPanel1;
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup layoutAnchorablePaneGroup = floatingWindow.RootPanel;
                    if (layoutAnchorablePaneGroup == null || layoutAnchorablePaneGroup.Orientation != Orientation.Vertical)
                    {
                        this._manager.Layout.RootPanel.Children.Insert(0, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] layoutAnchorablePaneArray = layoutAnchorablePaneGroup.Children.ToArray <ILayoutAnchorablePane>();
                        for (int j = 0; j < (int)layoutAnchorablePaneArray.Length; j++)
                        {
                            this._manager.Layout.RootPanel.Children.Insert(j, layoutAnchorablePaneArray[j]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.DockingManagerDockRight:
            {
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Horizontal && this._manager.Layout.RootPanel.Children.Count == 1)
                {
                    this._manager.Layout.RootPanel.Orientation = Orientation.Horizontal;
                }
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Horizontal)
                {
                    LayoutPanel layoutPanel2 = new LayoutPanel()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    layoutPanel2.Children.Add(this._manager.Layout.RootPanel);
                    layoutPanel2.Children.Add(floatingWindow.RootPanel);
                    this._manager.Layout.RootPanel = layoutPanel2;
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel1 = floatingWindow.RootPanel;
                    if (rootPanel1 == null || rootPanel1.Orientation != Orientation.Horizontal)
                    {
                        this._manager.Layout.RootPanel.Children.Add(floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] array1 = rootPanel1.Children.ToArray <ILayoutAnchorablePane>();
                        for (int k = 0; k < (int)array1.Length; k++)
                        {
                            this._manager.Layout.RootPanel.Children.Add(array1[k]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.DockingManagerDockBottom:
            {
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Vertical && this._manager.Layout.RootPanel.Children.Count == 1)
                {
                    this._manager.Layout.RootPanel.Orientation = Orientation.Vertical;
                }
                if (this._manager.Layout.RootPanel.Orientation != Orientation.Vertical)
                {
                    LayoutPanel layoutPanel3 = new LayoutPanel()
                    {
                        Orientation = Orientation.Vertical
                    };
                    layoutPanel3.Children.Add(this._manager.Layout.RootPanel);
                    layoutPanel3.Children.Add(floatingWindow.RootPanel);
                    this._manager.Layout.RootPanel = layoutPanel3;
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup layoutAnchorablePaneGroup1 = floatingWindow.RootPanel;
                    if (layoutAnchorablePaneGroup1 == null || layoutAnchorablePaneGroup1.Orientation != Orientation.Vertical)
                    {
                        this._manager.Layout.RootPanel.Children.Add(floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] layoutAnchorablePaneArray1 = layoutAnchorablePaneGroup1.Children.ToArray <ILayoutAnchorablePane>();
                        for (int l = 0; l < (int)layoutAnchorablePaneArray1.Length; l++)
                        {
                            this._manager.Layout.RootPanel.Children.Add(layoutAnchorablePaneArray1[l]);
                        }
                        break;
                    }
                }
            }
            }
            base.Drop(floatingWindow);
        }
Beispiel #7
0
            //---------------------------------------------------------------------------------------------------------
            /// <summary>
            /// Активация определённой вкладки
            /// </summary>
            /// <param name="layout">Вкладка</param>
            /// <param name="pane">Панель</param>
            /// <param name="pane_group">Группа панелей</param>
            /// <param name="layout_panel">Панель макета</param>
            //---------------------------------------------------------------------------------------------------------
            private void ActivePane(LayoutAnchorable layout, LayoutAnchorablePane pane, LayoutAnchorablePaneGroup pane_group,
                                    LayoutPanel layout_panel)
            {
                if (!layout.IsVisible)
                {
                    if (!pane.IsVisible)
                    {
                        if (!pane_group.IsVisible)
                        {
                            if (pane_group.Parent == null)
                            {
                                layout_panel.Children.Add(pane_group);
                            }
                        }

                        if (pane.Parent == null)
                        {
                            pane_group.Children.Add(pane);
                        }
                    }

                    if (layout.Parent == null)
                    {
                        pane.Children.Add(layout);
                    }
                    layout.IsVisible = true;
                }
            }
        internal LayoutAnchorablePane GetLayoutAnchorablePane()
        {
            if (layoutanchpanegroup == null)
            {
                layoutanchpanegroup = new LayoutAnchorablePaneGroup();
                layoutanchpanegroup.DockWidth = new GridLength(250);
            }

            if (layoutanchpane == null)
                layoutanchpane = new LayoutAnchorablePane();

            if (!layoutanchpanegroup.Children.Contains(layoutanchpane))
                layoutanchpanegroup.Children.Add(layoutanchpane);

            if (!LayoutPane.Children.Contains(layoutanchpanegroup))
            LayoutPane.Children.Add(layoutanchpanegroup);

            return layoutanchpane;
        }
        public void UpdateDocMinWidthHeightTest()
        {
            double             documentPaneDockMinHeight = 100;
            double             documentPaneDockMinWidth  = 101;
            LayoutDocumentPane layoutDocumentPane        = new LayoutDocumentPane {
                DockMinHeight = documentPaneDockMinHeight, DockMinWidth = documentPaneDockMinWidth
            };

            layoutDocumentPane.InsertChildAt(0, new LayoutDocument {
                ContentId = "Document"
            });

            LayoutDocumentPaneGroup layoutDocumentPaneGroup = new LayoutDocumentPaneGroup();

            layoutDocumentPaneGroup.InsertChildAt(0, layoutDocumentPane);

            double anchorablePane1DockMinHeight        = 150;
            double anchorablePane1DockMinWidth         = 151;
            LayoutAnchorablePane layoutAnchorablePane1 = new LayoutAnchorablePane {
                DockMinHeight = anchorablePane1DockMinHeight, DockMinWidth = anchorablePane1DockMinWidth
            };

            layoutAnchorablePane1.InsertChildAt(0, new LayoutAnchorable {
                ContentId = "Anchorable1"
            });

            double anchorablePane2DockMinHeight        = 200;
            double anchorablePane2DockMinWidth         = 201;
            LayoutAnchorablePane layoutAnchorablePane2 = new LayoutAnchorablePane {
                DockMinHeight = anchorablePane2DockMinHeight, DockMinWidth = anchorablePane2DockMinWidth
            };

            layoutAnchorablePane2.InsertChildAt(0, new LayoutAnchorable {
                ContentId = "Anchorable2"
            });

            LayoutAnchorablePaneGroup layoutAnchorablePaneGroup = new LayoutAnchorablePaneGroup {
                Orientation = Orientation.Horizontal
            };

            layoutAnchorablePaneGroup.InsertChildAt(0, layoutAnchorablePane1);
            layoutAnchorablePaneGroup.InsertChildAt(0, layoutAnchorablePane2);

            LayoutPanel layoutPanel = new LayoutPanel {
                Orientation = Orientation.Vertical
            };

            layoutPanel.InsertChildAt(0, layoutDocumentPaneGroup);
            layoutPanel.InsertChildAt(1, layoutAnchorablePaneGroup);

            Assert.AreEqual(anchorablePane2DockMinWidth + anchorablePane1DockMinWidth, layoutAnchorablePaneGroup.CalculatedDockMinWidth());
            Assert.AreEqual(Math.Max(anchorablePane2DockMinHeight, anchorablePane1DockMinHeight), layoutAnchorablePaneGroup.CalculatedDockMinHeight());

            Assert.AreEqual(documentPaneDockMinWidth, layoutDocumentPaneGroup.CalculatedDockMinWidth());
            Assert.AreEqual(documentPaneDockMinHeight, layoutDocumentPaneGroup.CalculatedDockMinHeight());

            Assert.AreEqual(
                Math.Max(anchorablePane1DockMinWidth + anchorablePane2DockMinWidth, documentPaneDockMinWidth),
                layoutPanel.CalculatedDockMinWidth());

            Assert.AreEqual(documentPaneDockMinHeight + anchorablePane2DockMinHeight, layoutPanel.CalculatedDockMinHeight());
        }
        public void CalculatedDockMinWidthHeightTest()
        {
            double defaultDockMinHeight = 25;
            double defaultDockMinWidth  = 25;

            const double       documentPaneDockMinHeight = 200;
            const double       documentPaneDockMinWidth  = 400;
            LayoutDocumentPane layoutDocumentPane        = new LayoutDocumentPane {
                DockMinHeight = documentPaneDockMinHeight, DockMinWidth = documentPaneDockMinWidth
            };

            layoutDocumentPane.InsertChildAt(0, new LayoutDocument {
                ContentId = "Document"
            });

            LayoutDocumentPaneGroup layoutDocumentPaneGroup = new LayoutDocumentPaneGroup();

            layoutDocumentPaneGroup.InsertChildAt(0, layoutDocumentPane);

            const double         anchorablePaneDockMinHeight = 80;
            const double         anchorablePaneDockMinWidth  = 160;
            LayoutAnchorablePane layoutAnchorablePane        = new LayoutAnchorablePane {
                DockMinHeight = anchorablePaneDockMinHeight, DockMinWidth = anchorablePaneDockMinWidth
            };

            layoutAnchorablePane.InsertChildAt(0, new LayoutAnchorable {
                ContentId = "Anchorable"
            });

            LayoutAnchorablePaneGroup layoutAnchorablePaneGroup = new LayoutAnchorablePaneGroup();

            layoutAnchorablePaneGroup.InsertChildAt(0, layoutAnchorablePane);

            LayoutPanel layoutPanel = new LayoutPanel();

            layoutPanel.InsertChildAt(0, layoutDocumentPaneGroup);
            layoutPanel.InsertChildAt(1, layoutAnchorablePaneGroup);

            Assert.AreEqual(defaultDockMinWidth, layoutPanel.DockMinWidth);
            Assert.AreEqual(defaultDockMinHeight, layoutPanel.DockMinHeight);
            Assert.AreEqual(documentPaneDockMinWidth + anchorablePaneDockMinWidth, layoutPanel.CalculatedDockMinWidth());
            Assert.AreEqual(Math.Max(documentPaneDockMinHeight, anchorablePaneDockMinHeight), layoutPanel.CalculatedDockMinHeight());

            Assert.AreEqual(documentPaneDockMinWidth, layoutDocumentPane.DockMinWidth);
            Assert.AreEqual(documentPaneDockMinHeight, layoutDocumentPane.DockMinHeight);
            Assert.AreEqual(layoutDocumentPane.DockMinWidth, layoutDocumentPane.CalculatedDockMinWidth());
            Assert.AreEqual(layoutDocumentPane.DockMinHeight, layoutDocumentPane.CalculatedDockMinHeight());

            Assert.AreEqual(defaultDockMinWidth, layoutDocumentPaneGroup.DockMinWidth);
            Assert.AreEqual(defaultDockMinWidth, layoutDocumentPaneGroup.DockMinHeight);
            Assert.AreEqual(documentPaneDockMinWidth, layoutDocumentPaneGroup.CalculatedDockMinWidth());
            Assert.AreEqual(documentPaneDockMinHeight, layoutDocumentPaneGroup.CalculatedDockMinHeight());

            Assert.AreEqual(anchorablePaneDockMinWidth, layoutAnchorablePane.DockMinWidth);
            Assert.AreEqual(anchorablePaneDockMinHeight, layoutAnchorablePane.DockMinHeight);
            Assert.AreEqual(layoutAnchorablePane.DockMinWidth, layoutAnchorablePane.CalculatedDockMinWidth());
            Assert.AreEqual(layoutAnchorablePane.DockMinHeight, layoutAnchorablePane.CalculatedDockMinHeight());

            Assert.AreEqual(defaultDockMinWidth, layoutAnchorablePaneGroup.DockMinWidth);
            Assert.AreEqual(defaultDockMinWidth, layoutAnchorablePaneGroup.DockMinHeight);
            Assert.AreEqual(anchorablePaneDockMinWidth, layoutAnchorablePaneGroup.CalculatedDockMinWidth());
            Assert.AreEqual(anchorablePaneDockMinHeight, layoutAnchorablePaneGroup.CalculatedDockMinHeight());

            layoutPanel.RemoveChild(layoutDocumentPaneGroup);
            Assert.AreEqual(anchorablePaneDockMinWidth, layoutPanel.CalculatedDockMinWidth());
            Assert.AreEqual(anchorablePaneDockMinHeight, layoutPanel.CalculatedDockMinHeight());
        }
Beispiel #11
0
        protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)
        {
            ILayoutAnchorablePane model            = this._targetPane.Model as ILayoutAnchorablePane;
            LayoutAnchorable      layoutAnchorable = floatingWindow.Descendents().OfType <LayoutAnchorable>().FirstOrDefault <LayoutAnchorable>();

            switch (base.Type)
            {
            case DropTargetType.AnchorablePaneDockLeft:
            {
                ILayoutGroup           parent = model.Parent as ILayoutGroup;
                ILayoutOrientableGroup layoutOrientableGroup = model.Parent as ILayoutOrientableGroup;
                int num = parent.IndexOfChild(model);
                if (layoutOrientableGroup.Orientation != Orientation.Horizontal && parent.ChildrenCount == 1)
                {
                    layoutOrientableGroup.Orientation = Orientation.Horizontal;
                }
                if (layoutOrientableGroup.Orientation != Orientation.Horizontal)
                {
                    ILayoutPositionableElement layoutPositionableElement = model as ILayoutPositionableElement;
                    LayoutAnchorablePaneGroup  layoutAnchorablePaneGroup = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = Orientation.Horizontal,
                        DockWidth   = layoutPositionableElement.DockWidth,
                        DockHeight  = layoutPositionableElement.DockHeight
                    };
                    parent.InsertChildAt(num, layoutAnchorablePaneGroup);
                    layoutAnchorablePaneGroup.Children.Add(model);
                    layoutAnchorablePaneGroup.Children.Insert(0, floatingWindow.RootPanel);
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel = floatingWindow.RootPanel;
                    if (rootPanel == null || rootPanel.Children.Count != 1 && rootPanel.Orientation != Orientation.Horizontal)
                    {
                        parent.InsertChildAt(num, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] array = rootPanel.Children.ToArray <ILayoutAnchorablePane>();
                        for (int i = 0; i < (int)array.Length; i++)
                        {
                            parent.InsertChildAt(num + i, array[i]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.AnchorablePaneDockTop:
            {
                ILayoutGroup           layoutGroup = model.Parent as ILayoutGroup;
                ILayoutOrientableGroup parent1     = model.Parent as ILayoutOrientableGroup;
                int num1 = layoutGroup.IndexOfChild(model);
                if (parent1.Orientation != Orientation.Vertical && layoutGroup.ChildrenCount == 1)
                {
                    parent1.Orientation = Orientation.Vertical;
                }
                if (parent1.Orientation != Orientation.Vertical)
                {
                    ILayoutPositionableElement layoutPositionableElement1 = model as ILayoutPositionableElement;
                    LayoutAnchorablePaneGroup  layoutAnchorablePaneGroup1 = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = Orientation.Vertical,
                        DockWidth   = layoutPositionableElement1.DockWidth,
                        DockHeight  = layoutPositionableElement1.DockHeight
                    };
                    layoutGroup.InsertChildAt(num1, layoutAnchorablePaneGroup1);
                    layoutAnchorablePaneGroup1.Children.Add(model);
                    layoutAnchorablePaneGroup1.Children.Insert(0, floatingWindow.RootPanel);
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel1 = floatingWindow.RootPanel;
                    if (rootPanel1 == null || rootPanel1.Children.Count != 1 && rootPanel1.Orientation != Orientation.Vertical)
                    {
                        layoutGroup.InsertChildAt(num1, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] layoutAnchorablePaneArray = rootPanel1.Children.ToArray <ILayoutAnchorablePane>();
                        for (int j = 0; j < (int)layoutAnchorablePaneArray.Length; j++)
                        {
                            layoutGroup.InsertChildAt(num1 + j, layoutAnchorablePaneArray[j]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.AnchorablePaneDockRight:
            {
                ILayoutGroup           layoutGroup1           = model.Parent as ILayoutGroup;
                ILayoutOrientableGroup layoutOrientableGroup1 = model.Parent as ILayoutOrientableGroup;
                int num2 = layoutGroup1.IndexOfChild(model);
                if (layoutOrientableGroup1.Orientation != Orientation.Horizontal && layoutGroup1.ChildrenCount == 1)
                {
                    layoutOrientableGroup1.Orientation = Orientation.Horizontal;
                }
                if (layoutOrientableGroup1.Orientation != Orientation.Horizontal)
                {
                    ILayoutPositionableElement layoutPositionableElement2 = model as ILayoutPositionableElement;
                    LayoutAnchorablePaneGroup  layoutAnchorablePaneGroup2 = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = Orientation.Horizontal,
                        DockWidth   = layoutPositionableElement2.DockWidth,
                        DockHeight  = layoutPositionableElement2.DockHeight
                    };
                    layoutGroup1.InsertChildAt(num2, layoutAnchorablePaneGroup2);
                    layoutAnchorablePaneGroup2.Children.Add(model);
                    layoutAnchorablePaneGroup2.Children.Add(floatingWindow.RootPanel);
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel2 = floatingWindow.RootPanel;
                    if (rootPanel2 == null || rootPanel2.Children.Count != 1 && rootPanel2.Orientation != Orientation.Horizontal)
                    {
                        layoutGroup1.InsertChildAt(num2 + 1, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] array1 = rootPanel2.Children.ToArray <ILayoutAnchorablePane>();
                        for (int k = 0; k < (int)array1.Length; k++)
                        {
                            layoutGroup1.InsertChildAt(num2 + 1 + k, array1[k]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.AnchorablePaneDockBottom:
            {
                ILayoutGroup           parent2 = model.Parent as ILayoutGroup;
                ILayoutOrientableGroup layoutOrientableGroup2 = model.Parent as ILayoutOrientableGroup;
                int num3 = parent2.IndexOfChild(model);
                if (layoutOrientableGroup2.Orientation != Orientation.Vertical && parent2.ChildrenCount == 1)
                {
                    layoutOrientableGroup2.Orientation = Orientation.Vertical;
                }
                if (layoutOrientableGroup2.Orientation != Orientation.Vertical)
                {
                    ILayoutPositionableElement layoutPositionableElement3 = model as ILayoutPositionableElement;
                    LayoutAnchorablePaneGroup  layoutAnchorablePaneGroup3 = new LayoutAnchorablePaneGroup()
                    {
                        Orientation = Orientation.Vertical,
                        DockWidth   = layoutPositionableElement3.DockWidth,
                        DockHeight  = layoutPositionableElement3.DockHeight
                    };
                    parent2.InsertChildAt(num3, layoutAnchorablePaneGroup3);
                    layoutAnchorablePaneGroup3.Children.Add(model);
                    layoutAnchorablePaneGroup3.Children.Add(floatingWindow.RootPanel);
                    break;
                }
                else
                {
                    LayoutAnchorablePaneGroup rootPanel3 = floatingWindow.RootPanel;
                    if (rootPanel3 == null || rootPanel3.Children.Count != 1 && rootPanel3.Orientation != Orientation.Vertical)
                    {
                        parent2.InsertChildAt(num3 + 1, floatingWindow.RootPanel);
                        break;
                    }
                    else
                    {
                        ILayoutAnchorablePane[] layoutAnchorablePaneArray1 = rootPanel3.Children.ToArray <ILayoutAnchorablePane>();
                        for (int l = 0; l < (int)layoutAnchorablePaneArray1.Length; l++)
                        {
                            parent2.InsertChildAt(num3 + 1 + l, layoutAnchorablePaneArray1[l]);
                        }
                        break;
                    }
                }
            }

            case DropTargetType.AnchorablePaneDockInside:
            {
                LayoutAnchorablePane      layoutAnchorablePane = model as LayoutAnchorablePane;
                LayoutAnchorablePaneGroup rootPanel4           = floatingWindow.RootPanel;
                int num4 = (this._tabIndex == -1 ? 0 : this._tabIndex);
                LayoutAnchorable[] layoutAnchorableArray = rootPanel4.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (int m = 0; m < (int)layoutAnchorableArray.Length; m++)
                {
                    LayoutAnchorable layoutAnchorable1 = layoutAnchorableArray[m];
                    layoutAnchorablePane.Children.Insert(num4, layoutAnchorable1);
                    num4++;
                }
                break;
            }
            }
            layoutAnchorable.IsActive = true;
            base.Drop(floatingWindow);
        }
Beispiel #12
0
        public override Geometry GetPreviewPath(OverlayWindow overlayWindow, LayoutFloatingWindow floatingWindowModel)
        {
            LayoutAnchorableFloatingWindow layoutAnchorableFloatingWindow = floatingWindowModel as LayoutAnchorableFloatingWindow;
            LayoutAnchorablePaneGroup      rootPanel = layoutAnchorableFloatingWindow.RootPanel;
            LayoutAnchorablePaneGroup      layoutAnchorablePaneGroup = layoutAnchorableFloatingWindow.RootPanel;

            switch (base.Type)
            {
            case DropTargetType.AnchorablePaneDockLeft:
            {
                Rect screenArea = base.TargetElement.GetScreenArea();
                screenArea.Offset(-overlayWindow.Left, -overlayWindow.Top);
                screenArea.Width = screenArea.Width / 2;
                return(new RectangleGeometry(screenArea));
            }

            case DropTargetType.AnchorablePaneDockTop:
            {
                Rect height = base.TargetElement.GetScreenArea();
                height.Offset(-overlayWindow.Left, -overlayWindow.Top);
                height.Height = height.Height / 2;
                return(new RectangleGeometry(height));
            }

            case DropTargetType.AnchorablePaneDockRight:
            {
                Rect width = base.TargetElement.GetScreenArea();
                width.Offset(-overlayWindow.Left, -overlayWindow.Top);
                width.Offset(width.Width / 2, 0);
                width.Width = width.Width / 2;
                return(new RectangleGeometry(width));
            }

            case DropTargetType.AnchorablePaneDockBottom:
            {
                Rect rect = base.TargetElement.GetScreenArea();
                rect.Offset(-overlayWindow.Left, -overlayWindow.Top);
                rect.Offset(0, rect.Height / 2);
                rect.Height = rect.Height / 2;
                return(new RectangleGeometry(rect));
            }

            case DropTargetType.AnchorablePaneDockInside:
            {
                Rect screenArea1 = base.TargetElement.GetScreenArea();
                screenArea1.Offset(-overlayWindow.Left, -overlayWindow.Top);
                if (this._tabIndex == -1)
                {
                    return(new RectangleGeometry(screenArea1));
                }
                Rect rect1 = new Rect(base.DetectionRects[0].TopLeft, base.DetectionRects[0].BottomRight);
                rect1.Offset(-overlayWindow.Left, -overlayWindow.Top);
                PathFigure pathFigure = new PathFigure()
                {
                    StartPoint = screenArea1.TopLeft
                };
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = new Point(screenArea1.Left, rect1.Top)
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = rect1.TopLeft
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = rect1.BottomLeft
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = rect1.BottomRight
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = rect1.TopRight
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = new Point(screenArea1.Right, rect1.Top)
                    });
                pathFigure.Segments.Add(new LineSegment()
                    {
                        Point = screenArea1.TopRight
                    });
                pathFigure.IsClosed = true;
                pathFigure.IsFilled = true;
                pathFigure.Freeze();
                return(new PathGeometry(new PathFigure[] { pathFigure }));
            }
            }
            return(null);
        }
Beispiel #13
0
        protected override void Drop(LayoutAnchorableFloatingWindow floatingWindow)
        {
            LayoutAnchorable[] array;
            int i;
            ILayoutDocumentPane model = this._targetPane.Model as ILayoutDocumentPane;

            switch (base.Type)
            {
            case DropTargetType.DocumentPaneDockLeft:
            {
                LayoutDocumentPaneGroup parent             = model.Parent as LayoutDocumentPaneGroup;
                LayoutDocumentPane      layoutDocumentPane = new LayoutDocumentPane();
                if (parent == null)
                {
                    ILayoutContainer        layoutContainer         = model.Parent;
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    layoutContainer.ReplaceChild(model, layoutDocumentPaneGroup);
                    layoutDocumentPaneGroup.Children.Add(layoutDocumentPane);
                    layoutDocumentPaneGroup.Children.Add(model as LayoutDocumentPane);
                }
                else if (!parent.Root.Manager.AllowMixedOrientation || parent.Orientation == Orientation.Horizontal)
                {
                    parent.Orientation = Orientation.Horizontal;
                    int num = parent.IndexOfChild(model);
                    parent.Children.Insert(num, layoutDocumentPane);
                }
                else
                {
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup1 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    parent.ReplaceChild(model, layoutDocumentPaneGroup1);
                    layoutDocumentPaneGroup1.Children.Add(layoutDocumentPane);
                    layoutDocumentPaneGroup1.Children.Add(model);
                }
                array = floatingWindow.RootPanel.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (i = 0; i < (int)array.Length; i++)
                {
                    LayoutAnchorable layoutAnchorable = array[i];
                    layoutDocumentPane.Children.Add(layoutAnchorable);
                }
                break;
            }

            case DropTargetType.DocumentPaneDockTop:
            {
                LayoutDocumentPaneGroup parent1             = model.Parent as LayoutDocumentPaneGroup;
                LayoutDocumentPane      layoutDocumentPane1 = new LayoutDocumentPane();
                if (parent1 == null)
                {
                    ILayoutContainer        layoutContainer1         = model.Parent;
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup2 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Vertical
                    };
                    layoutContainer1.ReplaceChild(model, layoutDocumentPaneGroup2);
                    layoutDocumentPaneGroup2.Children.Add(layoutDocumentPane1);
                    layoutDocumentPaneGroup2.Children.Add(model as LayoutDocumentPane);
                }
                else if (!parent1.Root.Manager.AllowMixedOrientation || parent1.Orientation == Orientation.Vertical)
                {
                    parent1.Orientation = Orientation.Vertical;
                    int num1 = parent1.IndexOfChild(model);
                    parent1.Children.Insert(num1, layoutDocumentPane1);
                }
                else
                {
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup3 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Vertical
                    };
                    parent1.ReplaceChild(model, layoutDocumentPaneGroup3);
                    layoutDocumentPaneGroup3.Children.Add(layoutDocumentPane1);
                    layoutDocumentPaneGroup3.Children.Add(model);
                }
                array = floatingWindow.RootPanel.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (i = 0; i < (int)array.Length; i++)
                {
                    LayoutAnchorable layoutAnchorable1 = array[i];
                    layoutDocumentPane1.Children.Add(layoutAnchorable1);
                }
                break;
            }

            case DropTargetType.DocumentPaneDockRight:
            {
                LayoutDocumentPaneGroup parent2             = model.Parent as LayoutDocumentPaneGroup;
                LayoutDocumentPane      layoutDocumentPane2 = new LayoutDocumentPane();
                if (parent2 == null)
                {
                    ILayoutContainer        layoutContainer2         = model.Parent;
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup4 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    layoutContainer2.ReplaceChild(model, layoutDocumentPaneGroup4);
                    layoutDocumentPaneGroup4.Children.Add(model as LayoutDocumentPane);
                    layoutDocumentPaneGroup4.Children.Add(layoutDocumentPane2);
                }
                else if (!parent2.Root.Manager.AllowMixedOrientation || parent2.Orientation == Orientation.Horizontal)
                {
                    parent2.Orientation = Orientation.Horizontal;
                    int num2 = parent2.IndexOfChild(model);
                    parent2.Children.Insert(num2 + 1, layoutDocumentPane2);
                }
                else
                {
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup5 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Horizontal
                    };
                    parent2.ReplaceChild(model, layoutDocumentPaneGroup5);
                    layoutDocumentPaneGroup5.Children.Add(model);
                    layoutDocumentPaneGroup5.Children.Add(layoutDocumentPane2);
                }
                array = floatingWindow.RootPanel.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (i = 0; i < (int)array.Length; i++)
                {
                    LayoutAnchorable layoutAnchorable2 = array[i];
                    layoutDocumentPane2.Children.Add(layoutAnchorable2);
                }
                break;
            }

            case DropTargetType.DocumentPaneDockBottom:
            {
                LayoutDocumentPaneGroup parent3             = model.Parent as LayoutDocumentPaneGroup;
                LayoutDocumentPane      layoutDocumentPane3 = new LayoutDocumentPane();
                if (parent3 == null)
                {
                    ILayoutContainer        layoutContainer3         = model.Parent;
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup6 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Vertical
                    };
                    layoutContainer3.ReplaceChild(model, layoutDocumentPaneGroup6);
                    layoutDocumentPaneGroup6.Children.Add(model as LayoutDocumentPane);
                    layoutDocumentPaneGroup6.Children.Add(layoutDocumentPane3);
                }
                else if (!parent3.Root.Manager.AllowMixedOrientation || parent3.Orientation == Orientation.Vertical)
                {
                    parent3.Orientation = Orientation.Vertical;
                    int num3 = parent3.IndexOfChild(model);
                    parent3.Children.Insert(num3 + 1, layoutDocumentPane3);
                }
                else
                {
                    LayoutDocumentPaneGroup layoutDocumentPaneGroup7 = new LayoutDocumentPaneGroup()
                    {
                        Orientation = Orientation.Vertical
                    };
                    parent3.ReplaceChild(model, layoutDocumentPaneGroup7);
                    layoutDocumentPaneGroup7.Children.Add(model);
                    layoutDocumentPaneGroup7.Children.Add(layoutDocumentPane3);
                }
                array = floatingWindow.RootPanel.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (i = 0; i < (int)array.Length; i++)
                {
                    LayoutAnchorable layoutAnchorable3 = array[i];
                    layoutDocumentPane3.Children.Add(layoutAnchorable3);
                }
                break;
            }

            case DropTargetType.DocumentPaneDockInside:
            {
                LayoutDocumentPane        layoutDocumentPane4 = model as LayoutDocumentPane;
                LayoutAnchorablePaneGroup rootPanel           = floatingWindow.RootPanel;
                bool flag = true;
                int  previousContainerIndex = 0;
                if (this._tabIndex != -1)
                {
                    previousContainerIndex = this._tabIndex;
                    flag = false;
                }
                LayoutAnchorable layoutAnchorable4 = null;
                array = rootPanel.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
                for (i = 0; i < (int)array.Length; i++)
                {
                    LayoutAnchorable layoutAnchorable5 = array[i];
                    if (flag)
                    {
                        if (((ILayoutPreviousContainer)layoutAnchorable5).PreviousContainer == model && layoutAnchorable5.PreviousContainerIndex != -1)
                        {
                            previousContainerIndex = layoutAnchorable5.PreviousContainerIndex;
                        }
                        flag = false;
                    }
                    layoutDocumentPane4.Children.Insert(previousContainerIndex, layoutAnchorable5);
                    previousContainerIndex++;
                    layoutAnchorable4 = layoutAnchorable5;
                }
                layoutAnchorable4.IsActive = true;
                break;
            }
            }
            base.Drop(floatingWindow);
        }