Use the PrincipalType
值来自EntityData
哈希表:
string principalType = pickerEntity1.EntityData["PrincipalType"].ToString();
我不记得所有可能的值,但是User
and SharePointGroup
绝对是其中之一。
moontear https://stackoverflow.com/users/266453/moontear的评论:
要列出该实体拥有的所有信息,EntityDataElements
数组很有帮助。为了SPGroup
这包含SPGroupID
, AccountName
, PrincipalType
.
贾尼斯·温伯格斯 https://stackoverflow.com/users/50173/janis-veinbergs的评论:
它可能包含来自的值Microsoft.SharePoint.Utilities.SPPrincipalType
枚举,但我还没有测试过。
干得好:
[Flags]
public enum SPPrincipalType
{
None = ,
User = 1,
DistributionList = 2,
SecurityGroup = 4,
SharePointGroup = 8,
All = SharePointGroup | SecurityGroup | DistributionList | User,
}