Exemple #1
0
 private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion)
 {
     checked
     {
         if (nestedPanesFrom.Count != 0)
         {
             int             count  = nestedPanesFrom.Count;
             DockPane[]      array  = new DockPane[count];
             DockPane[]      array2 = new DockPane[count];
             DockAlignment[] array3 = new DockAlignment[count];
             double[]        array4 = new double[count];
             for (int i = 0; i < count; i++)
             {
                 array[i]  = nestedPanesFrom[i];
                 array2[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
                 array3[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment;
                 array4[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
             }
             DockPane dockPane = array[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);
             array[0].DockState = nestedPanesTo.DockState;
             for (int i = 1; i < count; i++)
             {
                 for (int j = i; j < count; j++)
                 {
                     if (array2[j] == array[i - 1])
                     {
                         array2[j] = dockPane;
                     }
                 }
                 dockPane           = array[i].DockTo(nestedPanesTo.Container, array2[i], array3[i], array4[i]);
                 array[i].DockState = nestedPanesTo.DockState;
             }
         }
     }
 }
Exemple #2
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;
            }
        }
 internal NestedPaneCollection(INestedPanesContainer container) : base(new List <DockPane>())
 {
     this.m_container          = container;
     this.m_visibleNestedPanes = new VisibleNestedPaneCollection(this);
 }