17 November 2011

Even More of Getting Started with the TFS 2010 Object Model

Back in October, I presented on Getting Started with the TFS Object Model (as well as a look at what’s coming in Visual Studio 11) at the Tulsa TechFest.  I had intended to post the source code for the demos I ran through during my talk but I never got around to it and it completely slipped my mind.  A few days ago, I was gently reminded by one of the attendees (thanks Sean!) that I had not posted the source code so, here I am!

Below is a screen shot of the main window displayed by the demos.  This application has 10 basic types of functionality that can be demonstrated.  The first two are demonstrated by clicking on the ellipses buttons in the upper right of the window which will display a dialog allowing you to select a TFS Server/TPC and Team Project.

The remaining eight features are demonstrated by clicking on the remaining buttons, which include:

  • Get Version – demonstrates the ability to determine which version of TFS you’re communicating with – assuming you’re running on a client that has the TFS 2010 Team Explorer Client installed on it.
  • Get TPCs – lists all TPCs associated with the selected TFS server.
  • Get Team Projects – lists all Team Projects associated with the selected TPC.
  • Get Latest Build Info – displays a list of basic build information for all builds associated with the selected Team Project (an example of this is shown in the screenshot below).
  • Queue Build – queues a new build using the specified Build Name.
  • Get Work Item Count – displays the number of work items returned based on the WIQL query defined within the source code.
  • Create Work Item – creates a new, basic work item (in this case, a “Bug”).
  • Get Latest – demonstrates the ability to “Get Latest” source code from TFS.

API Demo Window

If you’re curious about the source code, you can download it from here.