public void Show(DockPanel dockPanel, DockState dockState)
{
if (dockPanel == null)
throw (new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
if (dockState == DockState.Unknown || dockState == DockState.Hidden)
throw (new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));
dockPanel.SuspendLayout(true);
this.DockPanel = dockPanel;
if (dockState == DockState.Float && this.FloatPane == null)
{
this.Pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, DockState.Float, true);
}
else if (this.PanelPane == null)
{
DockPane paneExisting = null;
foreach (DockPane pane in this.DockPanel.Panes)
if (pane.DockState == dockState)
{
paneExisting = pane;
break;
}
if (paneExisting == null)
{
this.Pane = this.DockPanel.DockPaneFactory.CreateDockPane(this.Content, dockState, true);
}
else
this.Pane = paneExisting;
}
this.DockState = dockState;
dockPanel.ResumeLayout(true, true); //we'll resume the layout before activating to ensure that the position
this.Activate(); //and size of the form are finally processed before the form is shown
}