Exemple #1
0
        static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo,
                                     DockPane prevPane, DockAlignment alignment, double proportion)
        {
            if (nestedPanesFrom.Count == 0)
            {
                return;
            }

            var count       = nestedPanesFrom.Count;
            var panes       = new DockPane[count];
            var prevPanes   = new DockPane[count];
            var alignments  = new DockAlignment[count];
            var proportions = new double[count];

            for (var i = 0; i < count; i++)
            {
                panes[i]       = nestedPanesFrom[i];
                prevPanes[i]   = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
                alignments[i]  = nestedPanesFrom[i].NestedDockingStatus.Alignment;
                proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
            }

            var pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);

            panes[0].DockState = nestedPanesTo.DockState;

            for (var i = 1; i < count; i++)
            {
                for (var j = i; j < count; j++)
                {
                    if (prevPanes[j] == panes[i - 1])
                    {
                        prevPanes[j] = pane;
                    }
                }
                pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
                panes[i].DockState = nestedPanesTo.DockState;
            }
        }
 internal NestedPaneCollection(INestedPanesContainer container) : base(new List <DockPane>())
 {
     m_container          = container;
     m_visibleNestedPanes = new VisibleNestedPaneCollection(this);
 }