c# - 团队基础服务器 2010 API

标签 c# .net tfs

我想知道是否有人知道一个显示使用 TFS 2010 的 API 示例的好网站。

我想开发一个项目,允许团队查看其他团队成员 checkout 的文件/项目。它只是一个系统,用户可以看到开发人员当前正在处理哪些项目。有没有人对此有任何经验可以提供入门建议?

我将使用 .NET(C# 或 VB)进行开发,应用程序将运行在 SQL Server 2008 数据库上。

最佳答案

正如 Alex 提到的,Attrice 的 TFS Sidekicks 具有此功能。

此外,TFS Power Tools允许您使用“在源代码管理中查找”来查看任何(或所有)用户 checkout 的文件。

但是,如果您确实想推出自己的解决方案,可以使用 TFS SDK 轻松实现。 .我会让文档说明一切,但您可能想要按照以下方式做一些事情:

TfsTeamProjectCollection projectCollection = new TfsTeamProjectCollection(new Uri("http://tfs.mycompany.com:8080/tfs/DefaultCollection"));
VersionControlServer vc = projectCollection.GetService<VersionControlServer>();

/* Get all pending changesets for all items (note, you can filter the items in the first arg.) */
PendingSet[] pendingSets = vc.GetPendingSets(null, RecursionType.Full);

foreach(PendingSet set in pendingSets)
{
    /* Get each item in the pending changeset */
    foreach(PendingChange pc in set.PendingChanges)
    {
        Console.WriteLine(pc.ServerItem + " is checked out by " + set.OwnerName);
    }
}

(注意:完全未经测试)

不过,我再次建议您查看这两个现有项目,看看它们是否符合您的需求。

关于c# - 团队基础服务器 2010 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9827798/

相关文章:

visual-studio - TFS 工作项查询策略不会在 Visual Studio 上刷新

c# - 使用鼠标滚动放大和缩小 ViewBox,并使用鼠标指针位置作为缩放原点

c# - Mvvm wpf : update value binding before leaving focus of input element

c# - Linq to SQL 左外连接使用 Lambda 语法和连接 2 列(复合连接键)

.net - 关于私有(private)方法单元测试的问题

c# - WCF OperationContract 属性忘记值

C# 2.0 代码使用使用 C# 3.0 编译的程序集

tfs - 如何将大量更改 checkin TFS

.net - 我如何在TFS中自动化分支机构/新团队的建立过程

c# - C#-DateTime 的 java 等价物是什么?