public override KryptonDockingEdgeAutoHidden FindDockingEdgeAutoHidden(string uniqueName)
{
// Try and find as an existing page inside the hierarchy
DockingElement element = FindPageElement(uniqueName) as DockingElement;
// If exists as a dockspace page...
if (element is KryptonDockingDockspace)
{
KryptonDockingEdge edge = element.GetParentType(typeof(KryptonDockingEdge)) as KryptonDockingEdge;
if (edge != null)
{
// Finally we grab the auto hidden edge that is expected to be a sibling of the docked edge
KryptonDockingEdgeAutoHidden edgeAutoHidden = edge["AutoHidden"] as KryptonDockingEdgeAutoHidden;
if (edgeAutoHidden != null)
return edgeAutoHidden;
}
}
// If exists as a auto hidden group page...
if (element is KryptonDockingAutoHiddenGroup)
{
// Find the edge the dockspace is against and return the matching auto hidden edge
KryptonDockingEdgeAutoHidden edge = element.GetParentType(typeof(KryptonDockingEdgeAutoHidden)) as KryptonDockingEdgeAutoHidden;
if (edge != null)
return edge;
}
// Second preference is to find an existing store page inside an auto hidden group element
KryptonDockingAutoHiddenGroup group = FindStorePageElement(DockingLocation.AutoHidden, uniqueName) as KryptonDockingAutoHiddenGroup;
if (group != null)
{
// Find the auto hidden edge that the group is inside
KryptonDockingEdgeAutoHidden edgeAutoHidden = group.GetParentType(typeof(KryptonDockingEdgeAutoHidden)) as KryptonDockingEdgeAutoHidden;
if (edgeAutoHidden != null)
return edgeAutoHidden;
}
// Third preference is to find an existing store page inside a docked element
KryptonDockingDockspace dockspace = FindStorePageElement(DockingLocation.Docked, uniqueName) as KryptonDockingDockspace;
if (dockspace != null)
{
// Navigate upwards to find the edge that this dockspace is inside
KryptonDockingEdge edge = dockspace.GetParentType(typeof(KryptonDockingEdge)) as KryptonDockingEdge;
if (edge != null)
{
// Finally we grab the auto hidden edge that is expected to be a sibling of the docked edge
KryptonDockingEdgeAutoHidden edgeAutoHidden = edge["AutoHidden"] as KryptonDockingEdgeAutoHidden;
if (edgeAutoHidden != null)
return edgeAutoHidden;
}
}
// Failed, so use default processing
return base.FindDockingEdgeAutoHidden(uniqueName);
}