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

            int count = nestedPanesFrom.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]       = nestedPanesFrom[i];
                prevPanes[i]   = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
                alignments[i]  = nestedPanesFrom[i].NestedDockingStatus.Alignment;
                proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
            }

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

            panes[0].DockState = nestedPanesTo.DockState;

            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].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
                panes[i].DockState = nestedPanesTo.DockState;
            }
        }
Exemplo n.º 2
0
 internal NestedPaneCollection(INestedPanesContainer container)
     : base(new List <DockPane>())
 {
     m_container          = container;
     m_visibleNestedPanes = new VisibleNestedPaneCollection(this);
 }