SPClaimProvider.FillHierarchy 方法

派生类中实现时,从声明提供程序加载**[T:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyTree]**树的部分的能力提供人员选取器控件和指定用于显示选取实体的层次结构。

命名空间:  Microsoft.SharePoint.Administration.Claims
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Protected MustOverride Sub FillHierarchy ( _
    context As Uri, _
    entityTypes As String(), _
    hierarchyNodeID As String, _
    numberOfLevels As Integer, _
    hierarchy As SPProviderHierarchyTree _
)
用法
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
)

参数

  • context
    类型:System.Uri

    上下文,为 URI。这必须是格式正确的 URI。

  • entityTypes
    类型:[]

    SPProviderHierarchyTree目录树返回**[P:HYPERLINK"mk:@MSITStore:D:\\\\aSDK\\\\SP2010SDK.chm::/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.PickerEntity.EntityType]**实体类型。

  • hierarchyNodeID
    类型:System.String

    **[P:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyNode.HierarchyNodeID]**节点中。如果返回空引用(无 在 Visual Basic 中) ,然后根。

  • numberOfLevels
    类型:System.Int32

    要返回层次结构的级别数。

备注

如果您想要在索赔选择器的左窗格中显示层次结构,您必须在SPClaimProvider类中实现此方法,并将SupportsHierarchy属性。

领料信息声明和解析,请参阅如何:在 SharePoint 2013 中创建声明提供程序SharePoint 2013 中的声明提供程序

示例

// 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);
}
}

另请参阅

引用

SPClaimProvider 类

SPClaimProvider 成员

Microsoft.SharePoint.Administration.Claims 命名空间