本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.GetAllTeamProjects方法的典型用法代码示例。如果您正苦于以下问题:C# VersionControlServer.GetAllTeamProjects方法的具体用法?C# VersionControlServer.GetAllTeamProjects怎么用?C# VersionControlServer.GetAllTeamProjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer
的用法示例。
在下文中一共展示了VersionControlServer.GetAllTeamProjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btn_dp_Click
/// <summary>
/// On Button Click
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_dp_Click(object sender, EventArgs e)
{
/*Code for picking from Server Picker TFS control
DomainProjectPicker dp = new DomainProjectPicker(DomainProjectPickerMode.AllowMultiSelect);
if (dp.ShowDialog() != DialogResult.Cancel)
{
}*/
//bgw.DoWork += new DoWorkEventHandler(bgw_DoWork);
//bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ProgressChanged);
//bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted);
//bgw.WorkerReportsProgress = true;
//bgw.RunWorkerAsync();
//pbrProgress.Visible = true;
string serverChecked;
if(rtnGIRMS27.Checked)
serverChecked= "GIRMS27";
else
serverChecked= "GIRMSC9";
_server = new TeamFoundationServer("http://"+serverChecked+":8080");
_server.EnsureAuthenticated();
_versionControl = (VersionControlServer)_server.GetService(typeof(VersionControlServer));
_securityService = (IGroupSecurityService)_server.GetService(typeof(IGroupSecurityService));
teamProjects = _versionControl.GetAllTeamProjects(false);
lstProjects.Items.Clear();
lstProjects.Items.Add("All TFS Projects");
lstProjects.Items.Add("");
dtView.DataSource = null;
dtView.Rows.Clear();
_glUsers.Clear();
foreach (TeamProject tp in teamProjects)
{
lstProjects.Items.Add(tp.Name);
Identity[] appGroups = _securityService.ListApplicationGroups(tp.ArtifactUri.AbsoluteUri);
foreach (Identity group in appGroups)
{
Identity[] groupMembers = _securityService.ReadIdentities(SearchFactor.Sid, new string[] { group.Sid }, QueryMembership.Expanded);
if (groupMembers.Length == 0) break;
foreach (Identity member in groupMembers)
{
if (member.Members.Length == 0) break;
if (member.Members != null)
{
foreach (string memberSid in member.Members)
{
Identity memberInfo = _securityService.ReadIdentity(SearchFactor.Sid, memberSid, QueryMembership.None);
if (memberInfo.Type != IdentityType.WindowsUser) continue;
if (_glUsers.Contains(memberInfo.Sid))
_userDetail = (UserDetails)_glUsers[memberInfo.Sid];
else
_userDetail = new UserDetails(memberInfo);
//update the project and permission
_userDetail.TeamProject = tp.Name;
_userDetail.Permission = group.DisplayName;
_userDetail.UpdateProjectAndPermission(tp.Name, group.DisplayName);
if (_glUsers.ContainsKey(memberInfo.Sid))
_glUsers.Remove(memberInfo.Sid);
_glUsers.Add(memberInfo.Sid, _userDetail);
}
}
}
}
}
int sn = 0;
dtView.Rows.Add(_glUsers.Count + 1);
foreach (UserDetails userIdentity in _glUsers.Values)
{
dtView.Rows[sn].Cells[0].Value = userIdentity.UserName;
dtView.Rows[sn].Cells[1].Value = userIdentity.ADId;
dtView.Rows[sn].Cells[2].Value = userIdentity.EmailAdd;
dtView.Rows[sn].Cells[3].Value = userIdentity.Domain;
string v = string.Empty;
Hashtable ht = userIdentity.PaR;
foreach (string str in userIdentity.PaR.Values)
{
v = string.Format("{0}{1}", v, str);
}
dtView.Rows[sn].Cells[4].Value = v;
dtView.Rows[sn].Cells[5].Value = userIdentity.Status;
sn++;
}
lblConnectedServer.Visible = true;
//.........这里部分代码省略.........