Skip to content

Commit

Permalink
Docking : Get the KryptonWorkspaceCell from a page
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocotteseb committed Nov 1, 2015
1 parent ea42f5f commit fe2e778
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3418,6 +3418,39 @@ public virtual KryptonWorkspaceCell[] CellsWorkspace
return cells.ToArray();
}
}

/// <summary>
/// Return the cell the page belongs to, when available (JDH Software add)
/// </summary>
/// <param name="uniqueName">The uniqueName of the page.</param>
/// <returns>The KryptonWorkspaceCell.</returns>
public KryptonWorkspaceCell DockingCellForPage(string uniqueName)
{
//Action depends on current location of the page
switch (this.FindPageLocation(uniqueName))
{
case DockingLocation.Docked:
// Unique name page must be inside a Dockspace instance
KryptonDockingDockspace dockspace = this.FindPageElement(uniqueName) as KryptonDockingDockspace;
// Find the cell containing the unique name page
return dockspace.CellForPage(uniqueName);
case DockingLocation.Floating:
// Unique name page must be inside a Dockspace instance
KryptonDockingFloatspace floatspace = this.FindPageElement(uniqueName) as KryptonDockingFloatspace;
// Find the cell containing the unique name page
return floatspace.CellForPage(uniqueName);
case DockingLocation.Workspace:
KryptonDockingWorkspace workspace = this.FindPageElement(uniqueName) as KryptonDockingWorkspace;
// Find the cell containing the unique name page
return workspace.CellForPage(uniqueName);
case DockingLocation.AutoHidden:
case DockingLocation.Navigator:
case DockingLocation.Custom:
case DockingLocation.None:
default:
return null;
}
}
#endregion

#region Protected
Expand Down

0 comments on commit fe2e778

Please sign in to comment.