private void MergeDockList(DisplayingDockList dockListFrom, DockList dockListTo, DockPane prevPane, DockAlignment alignment, double proportion)
        {
            if (dockListFrom.Count == 0)
            {
                return;
            }

            int count = dockListFrom.Count;

            DockPane[]      panes       = new DockPane[count];
            DockPane[]      prevPanes   = new DockPane[count];
            DockAlignment[] alignments  = new DockAlignment[count];
            double[]        proportions = new double[count];

            for (int i = 0; i < count; i++)
            {
                panes[i]       = dockListFrom[i];
                prevPanes[i]   = dockListFrom[i].NestedDockingStatus.PrevPane;
                alignments[i]  = dockListFrom[i].NestedDockingStatus.Alignment;
                proportions[i] = dockListFrom[i].NestedDockingStatus.Proportion;
            }

            DockPane pane = panes[0].AddToDockList(dockListTo.Container, prevPane, alignment, proportion);

            panes[0].DockState = dockListTo.DockState;
            panes[0].Activate();

            for (int i = 1; i < count; i++)
            {
                for (int j = i; j < count; j++)
                {
                    if (prevPanes[j] == panes[i - 1])
                    {
                        prevPanes[j] = pane;
                    }
                }
                pane = panes[i].AddToDockList(dockListTo.Container, prevPanes[i], alignments[i], proportions[i]);
                panes[i].DockState = dockListTo.DockState;
                panes[i].Activate();
            }
        }
Example #2
0
 internal DockList(IDockListContainer container)
 {
     m_container      = container;
     m_displayingList = new DisplayingDockList(this);
 }