SPClaimProvider.FillHierarchy Method

When implemented in a derived class, provides the People Picker control with the ability to load portions of the SPProviderHierarchyTree tree from the claims provider and specifies the hierarchy for displaying the picker entities.

Namespace:  Microsoft.SharePoint.Administration.Claims
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Protected MustOverride Sub FillHierarchy ( _
    context As Uri, _
    entityTypes As String(), _
    hierarchyNodeID As String, _
    numberOfLevels As Integer, _
    hierarchy As SPProviderHierarchyTree _
)
'Usage
Dim context As Uri
Dim entityTypes As String()
Dim hierarchyNodeID As String
Dim numberOfLevels As Integer
Dim hierarchy As SPProviderHierarchyTree

Me.FillHierarchy(context, entityTypes, _
    hierarchyNodeID, numberOfLevels, _
    hierarchy)
protected abstract void FillHierarchy(
    Uri context,
    string[] entityTypes,
    string hierarchyNodeID,
    int numberOfLevels,
    SPProviderHierarchyTree hierarchy
)

Parameters

  • context
    Type: System.Uri

    The context, as a URI. This must be a properly formatted URI.

  • hierarchyNodeID
    Type: System.String

    The HierarchyNodeID() node. If a null reference (Nothing in Visual Basic) then the root is returned.

  • numberOfLevels
    Type: System.Int32

    The number of levels of hierarchy to return.

Remarks

If you want to display hierarchy on the left pane of the claims picker, you must implement this method and the SupportsHierarchy property in the SPClaimProvider class.

For more information claims picking and resolution, see How to: Create a Claims Provider and Claims Provider.

Examples

// Return true if you support hierarchy display in People Picker
public override bool SupportsHierarchy
{
    get { return true; }
}
protected override void FillHierarchy(Uri context, String[] entityTypes, String hierarchyNodeID, int numberOfLevels, SPProviderHierarchyTree hierarchy)
{
    if (String.IsNullOrEmpty(hierarchyNodeID))
{
                hierarchy.AddChild(CreateHierarchyNodeForNodeID(MyLoginNameClaimType));
                hierarchy.AddChild(CreateHierarchyNodeForNodeID(MyClaimType));
}
else if (String.Equals(hierarchyNodeID, MyLoginNameClaimType, StringComparison.Ordinal))
{
    hierarchy.Name = GetHierarchyNodeNameForNodeID(hierarchyNodeID);
}
else if (String.Equals(hierarchyNodeID, MyClaimType, StringComparison.Ordinal))
{
    hierarchy.Name = GetHierarchyNodeNameForNodeID(hierarchyNodeID);
}
}

See Also

Reference

SPClaimProvider Class

SPClaimProvider Members

Microsoft.SharePoint.Administration.Claims Namespace