SPClaimProvider.FillHierarchy method
衍生的類別中實作時,能夠從宣告提供者載入**[T:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyTree]**樹狀目錄中的某些部分提供 「 人員選擇 」 控制項,並指定用於顯示選擇器實體的階層。
Namespace: Microsoft.SharePoint.Administration.Claims
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
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
Type: System.Uri為 URI 內容。這必須是格式正確的 URI。
entityTypes
Type: []會傳回SPProviderHierarchyTree樹狀目錄**[P:HYPERLINK"mk:@MSITStore:D:\\\\aSDK\\\\SP2010SDK.chm::/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.PickerEntity.EntityType]**實體類型。
hierarchyNodeID
Type: System.String[P:HYPERLINK"ms-help://MS.SPF14SDK.en/SPF14MrefControls/html/a4bf54d0-29e5-e5c2-231e-b1b9f4728a7f.htm"Microsoft.SharePoint.WebControls.SPProviderHierarchyNode.HierarchyNodeID] ] 節點。如果會傳回a null reference (Nothing in Visual Basic)然後根。
numberOfLevels
Type: System.Int32若要傳回的階層層級數目。
- hierarchy
Type: Microsoft.SharePoint.WebControls.SPProviderHierarchyTree
備註
如果您想要顯示階層宣告選擇器的左窗格上,您必須SPClaimProvider類別中實作此方法,將SupportsHierarchy屬性。
如需詳細資訊宣告挑選和解決方法,請參閱How to: Create a Claims Provider和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);
}
}