public virtual KryptonDockingWorkspace AddToWorkspace(string path, KryptonPage[] pages)
{
// Cannot add a null array
if (pages == null)
throw new ArgumentNullException("pages");
// Array must contain some values
if (pages.Length == 0)
throw new ArgumentException("pages cannot be zero length");
// Cannot action a null page reference
foreach (KryptonPage page in pages)
if (page == null)
throw new ArgumentNullException("pages array contains a null page reference");
// Resolve the given path to the expected docking workspace element
KryptonDockingWorkspace workspace = ResolvePath(path) as KryptonDockingWorkspace;
if (workspace == null)
throw new ArgumentException("Path does not resolve to a KryptonDockingWorkspace");
// Append pages to the workspace
workspace.Append(pages);
return workspace;
}