public void DockTo(DockPanel panel, DockStyle dockStyle)
{
if (panel != this.DockPanel)
throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
DockPane pane;
if (dockStyle == DockStyle.Top)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.DockTop, true);
else if (dockStyle == DockStyle.Bottom)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.DockBottom, true);
else if (dockStyle == DockStyle.Left)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.DockLeft, true);
else if (dockStyle == DockStyle.Right)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.DockRight, true);
else if (dockStyle == DockStyle.Fill)
pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.Document, true);
else
return;
}