25 May 2010

How to create an adapter for the TFS Integration Platform - Part I: Introduction

Note: This post is part of a series and you can find the rest of the parts in the series index.

Since September 2009 I have been engaged in a ALM Rangers project, namely the TFS Integration Platform. Which is:

The TFS Integration Platform is a project developed by the Team Foundation Server (TFS) product group and the Visual Studio ALM Rangers to facilitate the development of tools that integrate TFS with other systems. Currently, the scope of this project is to enable TFS to integrate with other version control and work-item/bug tracking systems, but the eventual goal of this project is to enable integration with a broader range of tools/systems (i.e. build). This platform enables the development of two major classifications of tools: tools that move data unidirectionally into TFS, and tools that synchronize data bidirectionally.

So in short it is a integration system, like BizTalk or SSIS but specially built for version control and work items. I have not said TFS there because, it can work to migrate between other source control and work item systems provided adapters exist. Adapters are the logic which allows the TFS platform to connect to a variety of technologies, and my goal has been to build two of them – one for SharePoint lists and one for SharePoint document libraries.

You may have noticed that SharePoint isn’t a version control or work item system, so why integrate? Well lots of companies do use it for ALM related items, such as the lists being used for tracking work items and the document libraries are used to store content which should be in a source control system. This is the first post in a series which will give you an idea of what is involved in building adapters, show you what to avoid and hopefully give you a few laughs at my expense. 

Now I want to be clear this series will not covering usage of the platform or any of the core concepts in it. For those please see the links below in particular Willy-Peter’s blog. You do need to understand a bit about how the platform works before you attempt to build your own adapter.

As all my work was done for the ALM Rangers the source code for my adapters is included in the code which can be obtained from the CodePlex site.

To help you on your way let’s list a few links which are key for this:

14 May 2010

DevDays Durban Slides and Bits

I had a great time in Durban this week presenting at the DevDays event. I was a bit nervous for my first keynote but calmed down once I was up there. I was much less nervous for the sessions and they turned out to be great fun.

Knowing is half the battle

As part of my prep I did fully script the demos and those scripts are included in hidden slides in the slide shows – so if you are looking to recreate the demos please download the slides and have a look.

For both my sessions I made use of the excellent (but I’m biased) Rule 18 tool. So if you looking for the actual code, which I referred to in my scripts with Rule 18 key presses, you should really download that too.

All the demos were done using Visual Studio 2010.

What’s new in ASP.NET 4?

What’s new in .NET 4?

28 Apr 2010

Writing JavaScript Easier with jQuery and Visual Studio 2010!

My first time presenting at DevDays was a great experience with me presenting in the community slot. I told the attendees of my session that they were the smart ones because  being at the end of the day, only the dedicated people were left and those dedicated people got two presentations for the price of one timeslot.

The session itself covered how writing JavaScript easier with jQuery and Visual Studio 2010 which you can see below. Now the slides below are not being done using some special PowerPoint to web tool, but are HTML which uses jQuery. Using the same technology as I was presenting on and building it in Visual Studio 2010 really highlighted how powerful and easy this was to do. To navigate the slides click the grey dots at the top or click on the slide and press = to go forward and – to go back.

They are a little wide for the website, so to see them in a new window click here

The demo used jQuery and Visual Studio 2010 to clean up the page, and then connect to StackOverflow to pull down my stats and display them to the audience. The completed demo code (which is not included above, so the demo page won’t work) is as follows (this goes in the HEAD tags in demo .html page):

<script src="jQuery/jquery-1.4.2.js" type="text/javascript"></script>

<script type="text/javascript"> 
$(document).ready(function () {

function gapSO(e) {
///<summary>Gets and parses Stack Overflow Points</summary>
  var sourceDiv = $(this);
  var replacementText = "I have ";
  var stackOverflowURL = "http://stackoverflow.com/users/flair/53236.json";
  $.getJSON(stackOverflowURL, function (data) {
    replacementText += data.reputation + " points and " + data.badgeHtml + " badges on StackOverflow";
23 Apr 2010

Find Results Tweak - Now with less suck

extensionmanager I posted the other day about a Visual Studio add-in which I developed. When developing it, I used the add-in model which has a nasty side effect, it needs to be installed with a MSI. Visual Studio 2010 can also be extended with packages and these can be deployed using the VSIX format.

What is this magical new VSIX format? It is basically a ZIP file which contains everything you need plus a manifest which tells VS how to use it. What makes this much better is that VS handles the install itself, so no MSI is needed. It is also then listed in the Extension Manager and so can take advantage of the features there by being disabled/uninstalled easily, not that you would want to.

A great side effect of this is that the new extension model let me add a little more error handling to the tool to help out debugging it. To get the new version go to http://findresultstweak.codeplex.com

20 Apr 2010

Tweaking the Find Results window in Visual Studio 2010

Visual Studio is filled with goodness and happiness and a lot of that is available for tweaking, so you can get the maximum goodness, via the Tool -> Options menu. One of the things which doesn’t have any visible options is the formatting of the way the results are displayed:


The problem, as indicated above, is a ton of white space, long file paths, no column information etc… Wouldn’t it be great to tweak how that can be displayed? Thankfully Sara Ford found a way to do exactly that via the registry. So you could tweak it to actually display the way you want it!


In my tweaked way it is far more condense with just the filename (no more path), less whitespace (since I am showing only a summary of results) and I also included the column info. The problem is that editing the registry is not user friendly :( This gave me a chance to write my first Visual Studio add-in, which gives you an option inside Visual Studio to set it.


What is really nice is that while you configure the format, the preview window will update and show you how it looks so you do not get any surprises when you save it! If you would like to find out more about it you can go to the site on CodePlex at http://findresultstweak.codeplex.com/

12 Apr 2010

Installing TFS 2010 Basic on a Laptop

I decided that I would like show how easy it is to install TFS 2010 on a laptop in an upcoming presentation, but I also want to use that TFS installation for demo’s which is a worry – what happens if the install fails? So what I decided to do was create a video of me installing TFS, this way I can show the video and not worry about my demos not working because of some demo failure. As I am such as nice guy, I decided to share it with everyone on YouTube, so here is the video:

27 Jan 2010

How I Build Presentations, appendix 2: Gadgets

For the rest in the posts in this series please see the series index.

Part of presenting a good presentation is using the right tool for the job. Often that may mean PowerPoint to present content, or demos to help get the point across. Sometimes it means building an entire slide show system out of the technology you are showing off to (as I did with jQuery). In this post I will open my bag of gadgets I tend to use in my presentations.

Now first off, I do not use every gadget in every presentation (right tool for the job again), but these are my favourites which I use often.

Logitech V450 Laser Wireless Mouse


I have a fairly standard wireless mouse from Logitech which is actually a great tool for a presenter, because you can use it to move forward through slides like a slide clicker device from around the room – no more being tied to the table. I can use the mouse wheel to go backwards too. While there are more dedicated mice for this job, a simple wireless does it just fine.

Windows 7

Windows 7 is my choice for presenting because of a number of great features it has specifically for presenters, which are all available via hot-keys!

Keyboard combination Description Screenshot

ÿ + P

Easily enables you to turn on a remote screen in either duplication or extended mode. No more funny fn+F something that is hardware specific. image

ÿ + X

The mobility centre is only on laptops, tablets etc… but on those devices you can change a number of settings quickly. Most important for presenting is the Presentation Settings option which allows you to
  1. Set a specific volume
  2. Disable the screen saver
  3. Set a specific wallpaper (so you can hide that picture of the Bulls Cheerleaders when you present, and have it reappear when you are done)

To configure it click the projector icon image  (that is actually a button).

ÿ + + (That is windows key and the plus key)

ÿ + -

These two keyboard shortcuts enable the Windows 7 magnifier which allows you to zoom in on something with the plus, and zoom out with the minus. What makes this really great is the fact it is a live zoom, so you can type and work still while zoomed in! image

Visual Studio 2010

I know it’s still in beta, but it really has replaced VS2008 as my IDE for demos for a few reasons:

  1. The IDE is now based on WPF, so it looks much clearer when projected on screen.
  2. The built in text zoom feature means I can zoom in and out of code easily.
  3. Multi-targeting of the framework means that my .NET 2.0, 3.0, 3.5 and 4.0 demos can all work in a single IDE.
  4. The extension support is so much better than the old add-in model, and being able to drag images into code or have twitter integration in the IDE is a great plus.

SysInternals ZoomIt

zoomit2 SysInternals has a tool called ZoomIt which has been a stable of my demos for ages as it contains three powerful features:

  1. The ability to zoom in – originally just static but in newer versions it also has a live zoom like Windows 7 has.
  2. The ability to draw on the screen – So often I want to highlight code or some text on the screen and ZoomIt makes my screen a canvas with arrows, text and free drawing. This can be combined with the zoom feature.
  3. Count down- You can fire up a full screen count down, which not only scares people sitting next to me on a plane but also allows me to have a timer for when a session will start. This is most useful in my full day (or longer) courses where there are smoke or lunch breaks.

ZoomIt Screenshot is taken from Ben Craigo’s blog

Rule 18

image A self built application for managing text snippets for usage during demos.

The core idea is that while in a demo, I often need to type code on the screen however this is error prone and time consuming, so what else can I do? Visual Studio does support putting text in the toolbox, however this has failed on me in the past, so I do not trust it. Visual Studio also supports snippets which are a bit of overkill to setup, especially if I have a number of back to back sessions. Also what about outside Visual Studio? What are my options in PowerShell for instance?

For a while I have used a simple text file and copy/paste which is great since it means I can include it in the slide deck, I won’t forget about it, and it works everywhere. Yet it is not elegant, and remember what I said about changes on the screen – flipping to notepad the whole time is very distracting.

So I built a Rule 18 which is a simple application, where you put snippets of text into it, the application will automatically assign each snippet a keyboard shortcut and when you press that shortcut the snippet is copied to the Windows clipboard – ready to be pasted into any application you choose to use. Now you just have to remember the shortcut keys (which is why they are in my demo scripts)!

Rule 18 also stores the data as XML which means if I do not have the app or it is crashing, I can fall back to the notepad way of doing things!