简体   繁体   English

Team Foundation Server 2010 API

[英]Team Foundation Server 2010 API

I was wondering if anyone knew of a good site showing examples of using TFS 2010's API. 我想知道是否有人知道一个好的网站显示使用TFS 2010的API的例子。

I would like to develop a project that would allow a team to see which files/items other team members had checked out. 我想开发一个项目,允许团队查看其他团队成员已签出的文件/项目。 It simply a system users could see which projects developers are currently working on. 它只是一个系统用户可以看到开发人员目前正在开发哪些项目。 Does any one have any experience with this that could give advise to get started? 有没有人有这方面的经验,可以提供入门建议?

I would be developing in .NET (C# OR VB) and the application would ride on a SQL Server 2008 database. 我将在.NET(C#OR VB)中开发,应用程序将使用SQL Server 2008数据库。

As Alex mentions, TFS Sidekicks from Attrice has this functionality. 正如Alex提到的那样,Attrice的TFS Sidekicks具有此功能。

In addition, the TFS Power Tools allows you to use "Find in Source Control" to see what files are checked out by any (or all) users. 此外, TFS Power Tools允许您使用“在源代码管理中查找”来查看由任何(或所有)用户签出的文件。

However, if you did want to roll your own solution, you could do so pretty easily using the TFS SDK . 但是,如果您确实想要推出自己的解决方案,则可以使用TFS SDK轻松完成。 I'll let the documentation speak for itself, but you'll probably want to do something along the lines of: 我会让文档说明一切,但你可能想要做一些事情:

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);
    }
}

(Note: totally untested) (注意:完全未经测试)

But again, I'd recommend you check out those two existing projects to see if they fit your needs. 但同样,我建议您查看这两个现有项目,看看它们是否符合您的需求。

TFS Sidekicks by Attrice already does this and a lot more. Attrice的TFS Sidekicks已经做到了这一点以及更多。 Plus, it's free 另外,它是免费的

TFS Sidekicks TFS Sidekicks

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM