public DockPane DockTo(INestedPanesContainer container, DockPane previousPane, DockAlignment alignment, double proportion)
{
if (container == null)
throw new InvalidOperationException(Strings.DockPane_DockTo_NullContainer);
if (container.IsFloat == this.IsFloat)
{
this.InternalAddToDockList(container, previousPane, alignment, proportion);
return this;
}
IDockContent firstContent = this.GetFirstContent(container.DockState);
if (firstContent == null)
return null;
DockPane pane;
this.DockPanel.DummyContent.DockPanel = this.DockPanel;
if (container.IsFloat)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.DockPanel.DummyContent, (FloatWindow)container, true);
else
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.DockPanel.DummyContent, container.DockState, true);
pane.DockTo(container, previousPane, alignment, proportion);
this.SetVisibleContentsToPane(pane);
this.DockPanel.DummyContent.DockPanel = null;
return pane;
}