zoukankan      html  css  js  c++  java
  • c#通过编码检查是否有PendingChanges没有签入

    using Microsoft.TeamFoundation.Client;
    using Microsoft.TeamFoundation.VersionControl.Client;
    
    var pendingList = new List<KeyValuePair<string, string>>();
                foreach (var ser in RegisteredTfsConnections.GetProjectCollections())
                {
                    var server = RegisteredTfsConnections.GetProjectCollection(new Uri(ser.Uri.ToString()));
                    var projects = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(server);
                    var versionControl = (VersionControlServer)projects.GetService(typeof(VersionControlServer));
                    var userName = versionControl.AuthorizedUser;
                    var workspaces = versionControl.QueryWorkspaces(null, userName, System.Net.Dns.GetHostName());
                    foreach (var workspace in workspaces)
                    {
                        var pendingChanges = workspace.GetPendingChanges();
                        foreach (PendingChange pendingChange in pendingChanges)
                        {
                            var pendingItem = new KeyValuePair<string, string>(server.Name, pendingChange.LocalItem);
                            pendingList.Add(pendingItem);
                            Console.WriteLine("{0}\t{1}", pendingItem.Key, pendingItem.Value);
                        }
                    }
                }
                Console.In.ReadLine();
  • 相关阅读:
    NTP服务器
    sublime中文设置
    13、软件定时器
    晶振和CPU周期
    红外通信协议
    KEIL使用时的一些配置
    STM32 的内部 FLASH
    STM32的程序下载
    2、触摸屏
    目录
  • 原文地址:https://www.cnblogs.com/nanfei/p/2792943.html
Copyright © 2011-2022 走看看