public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
{
if (dockStyle == DockStyle.Fill)
{
IDockContent activeContent = this.ActiveContent;
for (int i = this.Contents.Count - 1; i >= 0; i--)
{
IDockContent c = this.Contents[i];
if (c.DockHandler.DockState == this.DockState)
{
c.DockHandler.Pane = pane;
if (contentIndex != -1)
pane.SetContentIndex(c, contentIndex);
}
}
pane.ActiveContent = activeContent;
}
else
{
if (dockStyle == DockStyle.Left)
this.DockTo(pane.NestedPanesContainer, pane, DockAlignment.Left, 0.5);
else if (dockStyle == DockStyle.Right)
this.DockTo(pane.NestedPanesContainer, pane, DockAlignment.Right, 0.5);
else if (dockStyle == DockStyle.Top)
this.DockTo(pane.NestedPanesContainer, pane, DockAlignment.Top, 0.5);
else if (dockStyle == DockStyle.Bottom)
this.DockTo(pane.NestedPanesContainer, pane, DockAlignment.Bottom, 0.5);
this.DockState = pane.DockState;
}
}