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.
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.
TFS Sidekicks by Attrice already does this and a lot more. Plus, it's free
TFS Sidekicks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With