public virtual KryptonDockingAutoHiddenGroup InsertAutoHiddenGroup(string path,
DockingEdge edge,
int index,
KryptonPage[] pages,
params KryptonPage[][] extraPages)
{
// 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 control element
KryptonDockingControl control = ResolvePath(path) as KryptonDockingControl;
if (control == null)
throw new ArgumentException("Path does not resolve to a KryptonDockingControl");
// Find the requested target edge
KryptonDockingEdge edgeElement = control[edge.ToString()] as KryptonDockingEdge;
if (edgeElement == null)
throw new ArgumentException("KryptonDockingControl does not have the requested edge.");
// Find the auto hidden edge
KryptonDockingEdgeAutoHidden edgeAutoHidden = edgeElement["AutoHidden"] as KryptonDockingEdgeAutoHidden;
if (edgeAutoHidden == null)
throw new ArgumentException("KryptonDockingControl edge does not have an auto hidden element.");
KryptonDockingAutoHiddenGroup autoHiddenGroup = null;
using (DockingMultiUpdate update = new DockingMultiUpdate(this))
{
// Create a new auto hidden group and add the provided array of pages
autoHiddenGroup = edgeAutoHidden.InsertAutoHiddenGroup(index);
autoHiddenGroup.Append(pages);
// If we have extra pages then we need to add extra auto hidden groups
if ((extraPages != null) && (extraPages.Length > 0))
{
// For each array of pages...
foreach (KryptonPage[] pageArray in extraPages)
if ((pageArray != null) && (pageArray.Length > 0))
{
// Create a new auto hidden group and add the provided array of pages
KryptonDockingAutoHiddenGroup extraAutoHiddenGroup = edgeAutoHidden.AppendAutoHiddenGroup();
extraAutoHiddenGroup.Append(pageArray);
}
}
}
return autoHiddenGroup;
}