TFS: Team Build Monitor Gadget

Inspired by Darren’s recent CTP release of his updated World Cup Cricket Gadget, tonight I implemented a little gadget for Windows Vista that allows to you monitor the build store of a Team Foundation Server. This was a fun little project, because it made use of three of my favourite things: WPF, TFS and Gadgets. You can download it here:

http://www.paulstovell.net/Gadgets/TeamBuildMonitor.gadget

The gadget is a Windows Presentation Foundation XAML Browser Application (XBAP) hosted within an iframe, as per Karsten Januszewski’s tutorial. Every 30 seconds it calls the Team Foundation Server API’s to get build data, and then displays them as either red (failed), green (passed) or blue (in progress). You can click the “Settings” link to set the TFS server that you want to connect to, as well as the team project and the team build that you want to monitor.

There are some limitations in this gadget, the main one being that it doesn’t support multi-instances. You can add the gadget multiple times, but when you tell it to save the settings, it will overwrite the settings for the other instances. The Vista Sidebar Gadget API does provide the ability to save settings at the instance level, but they use Javascript and so my XBAP can’t get at them.

I did attempt to kludge the system by having the javascript save a random number to the gadget settings when the gadget is first added, and pass that to the XBAP using the query string of the XBAP file in the iframe, with my plan being to read the value out using the ApplicationDeployment class as Joseph Cooney explained, however because the XBAP is local the browser doesn’t seem to pass the complete URL to the file. If you can suggest any workarounds I’d love to hear it.

Here’s the list of features I’d like to add later:

  1. Multiple instances.
  2. Being able to right-click a build and perform a Get Specific Version on that version of the code. This would allow you to always ensure you are getting a working version of the code.
  3. Being able to right-click a build and view the Drop location of the files, as well as maybe the build log. Update: done
  4. Setting a “friendly name” so you can customise what’s displayed in the title. Update: done
  5. Having it automatically list the builds/projects available, and use the inbuilt TFS server and project selector dialogs.

I think to do these I’ll change the approach to use the ActiveX model that Karsten explains to give me better integration with the Javascript API’s. But in continuing the theme set forth by Darren for releasing CTP gadgets early, I thought I’d post what I have so far. I hope it’s useful!

Update: Charles Sterling also has a great walkthrough to creating an ActiveX WPF sidebar gadget.

Update 2: Daniel Crowley-Wilson also produced an excellent video of how to host an XBAP in a gadget as part of Readify’s TechTutorials series.

2 Responses to “TFS: Team Build Monitor Gadget”

  1. […] Build Monitor Gadget 18 03 2007 Interesting, this is the second time this week that I have heard about a Windows Sidebar gadget that talks to the Build Store…. I won’t let you know the first because I heard of it first hand and I have noticed that the […]

  2. Hi Paul
    Did you ever get multiple instances working as I am trying the same thing but have the same problem, that multiple instances are not working.
    Thanks
    Riedoh

Leave a Reply