他无法获取属于使用基于 TeamProjectPicker 即时 WPF 的用户的组名:
private void BtnConnectClick(object sender, RoutedEventArgs e)
{
DisableUi();
var tpp = new TeamProjectPicker(TeamProjectPickerMode.NoProject, false);
tpp.ShowDialog();
if (tpp.SelectedTeamProjectCollection == null) return;
EnableUi();
_tfs = tpp.SelectedTeamProjectCollection;
_css = (ICommonStructureService)_tfs.GetService<ICommonStructureService>();
_gss = (IGroupSecurityService)_tfs.GetService<IGroupSecurityService>();
var allSids = _gss.ReadIdentity(SearchFactor.AccountName,
"Project Collection Valid Users", QueryMembership.Expanded);
listAllUsers.ItemsSource = _gss.ReadIdentities(SearchFactor.Sid, allSids.Members,
QueryMembership.None).Where(a => a.Type == IdentityType.WindowsUser
|| a.Type == IdentityType.WindowsGroup);
listProjects.ItemsSource = _css.ListAllProjects();
}
在asp.net MVC上实现这个功能时我做不到