Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team Foundation Server 2010 API

Tags:

c#

.net

tfs

I was wondering if anyone knew of a good site showing examples of using TFS 2010's 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.

like image 597
JBone Avatar asked Mar 22 '12 17:03

JBone


2 Answers

As Alex mentions, TFS Sidekicks from Attrice has this functionality.

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.

However, if you did want to roll your own solution, you could do so pretty easily using the 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.

like image 182
Edward Thomson Avatar answered Oct 17 '22 15:10

Edward Thomson


TFS Sidekicks by Attrice already does this and a lot more. Plus, it's free

TFS Sidekicks

like image 2
Alex Avatar answered Oct 17 '22 14:10

Alex