Visual Studio Visualisers
Visualisers are just one of the nice new features to be found in Visual Studio 2005 alongside the enhanced debugger and a myriad of other things I have yet the time to explore. Visualisers however can be registered for all different types of variables.
Some visualisers come ‘built-in’ and others you can write yourself.In short, a visualiser allows you to customise the way data looks as you are stepping through and debugging code.
An example use of a visualiser might be for a variable of type ’string’. Normally mousing over the variable would produce some archaic representation of the contents represented within; like a clumsy data tip. If this strings contents are html, xml or some other format then it is going to include a lot of tag information. This makes reading the data tip information at a glance very difficult. Thankfully the new visualisers correct this, providing a more elegant way of viewing your data. Now, when you mouse over a variable (in this case a ’string’) any registered visualisers (for that data type) will be available for selection. If you know the contents within the string are html, then you can select to open the strings contents using an html visualiser. This will open the contents of the string in your default web browser, in this case, actually rendering the html so you can see exactly how it looks.
In a similar fashion, a ‘text viewer’ visualiser is a good choice for text that contains paragraphs and other formatting.Basically, visualisers provide you with a way of viewing data types the way they were meant to be viewed. No longer are you constrained to stuffing sql and other forms of text into a string with no perceivable way of easily reading it.
It doesn’t stop there either. Whilst Visual Studio 2005 does include some built-in visualisers for the basic data types this doesn’t stop you from writing your own ‘visual plugin’. The IDE provides proper support for providing the necessary interfaces and libraries to hook your visualiser into the IDE display, allowing it to be registered to a data type as a visualiser. Other such examples might include a visualiser that allows you to view a image stored within an object.
The possibilities are endless and this truly is one feature I’m excited to play with.As always, i’ve provided a link to a video from Channel 9 that provides a much more in-depth look at what visualisers are and what they afford.Tech Tags: Microsoft MSDN Channel+9 Visual+Studio Visualisers Visualizers Visual+Studio+Visualisers

Leave a Reply