Jake Ginnivan's blog

TFS Merge Tools Configuration

When I first install Visual Studio and TFS Explorer, high on my priorities is to configure a decent merge tool.

This blog post http://blogs.msdn.com/b/jmanning/archive/2006/02/20/diff-merge-configuration-in-team-foundation-common-command-and-argument-values.aspx lists all common merge tools, and the command line arguments for each of them.

I use KDiff, so the Compare arguments are %1 --fname %6 %2 --fname %7 and Merge arguments are %3 --fname %8 %2 --fname %7 %1 --fname %6 -o %4

Great, except I have to register all the extensions that I want to use KDiff for. This is my list:

.xml,.xaml,.cs,.csproj,.sln,.config,.msbuild,.txt,.cmd,.bat,.ps1,.nuspec,.xsd,.tasks,.xsl,.resx,.vb,.sql,.rptproj,.rdl,.rss,.settings

What other extensions am I missing?

VSTO Contrib RibbonFactory

Why?

When I started creating a RibbonFactory, I hadn’t actually looked into the way VSTO does it, I just wanted to use Ribbon XML, because it has more flexibility, but have a single class to represent a single ribbon and also support an IoC container, and DI for my ribbons.

Once I got that working, I started tweaking, improving, adding in context awareness and a view other things. Recently my reasons for trying to finish this have been:

  • Lack of IoC/DI support in VSTO
  • Cost of brute force reflection when using ribbon designer
  • Wanting to use Ribbon XML over Ribbon Designer, but not really viable due to missing context for ribbon xml.
  • Ribbon XML having a single callback file
  • Making custom task panes, which are associated with a ribbon (i.e. button to show/hide custom task pane) really simple.

The VSTO tooling is pretty good, especially around the designer, but I want the best of both worlds, and to be able to fall into the pit of success as Paul Stovell often says.

Introduction to VSTO Contrib

Goal of VSTO Contrib

When I first started on this library, it was a very simple set of classes designed to help me do trivial tasks in VSTO, such as simplifying listening to certain events, wrappers, and it was really a dumping ground for code that solved problems I had while developing VSTO solutions.

Just before TechEd last year (August), I started trying to tackle some more fundamental architectural issues, such as no ability to use DI, or IoC, which often causes VSTO solutions to have Ribbons with hundreds of lines of code behind, this issue is made worse with Ribbon XML which only lets you have a single callback file for ALL ribbons.

Retry.For

With UI automation, you are constantly dealing with race conditions, especially in a good WPF app which lazy loads most things, and while we have put a lot of good helpers in place (WaitWhileBusy etc), there are still times where a button does not enable quick enough, or a windows is opening and if you do not have automatic retry enabled you will have quite fragile UI automation tests.

This is where my Retry static class comes in handy.

VSTO Add-in Uninstaller

I have just pushed up a simple app to uninstall VSTO add-ins, if the manifest file is present, it will use the VSTOInstaller.exe, otherwise it will remove the registry keys manually.

Addin Uninstaller

Grab it at http://vstocontrib.codeplex.com/

Windows Phone 7 Frameworks Presentation

Windows Phone 7 Frameworks

Windows phone 7 frameworks have been popping up quite rapidly, and I have found each has benefits and drawbacks. You may be asking questions like, do I need a framework? What will it give me over rolling my own?

In this session I will be giving an introduction to windows phone development, and they diving into a few key area’s in windows phone development like lifecycle (tombstoning etc), navigation and general mvvm support.

You will leave knowing much more about Windows Phone 7 dev, and how to select the framework for your application

The Talk Details

Talk Link: http://perthdotnet.org/blogs/events/archive/2011/02/14/windows-phone-7-frameworks-with-jake-ginnivan.aspx

When: Thursday, Mar 3rd, 5:30pm - 7:00pm
Where: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth

The frameworks

So far the frameworks I am aware of:

Columbus - written by Artem Govorov
Windows Phone MVP - written by Brendan Kowitz
Calburn Micro - written by Rob Eisenberg
MVVM Light - written by Laurent Bugnion (GalaSoft)

If you know of others let me know, and tell me what is your favourite thing in that framework.

Blog Redesign

As part of my redesign, I have also changed web hosts. My apologies to anyone that has had their RSS feeds spammed by the process of me rebuilding my blog. I also have not transferred comments yet, I hopefully will get around to that shortly!

If you have a spare moment, could you give some feedback on:

What do you think of my new blog theme? What content do you like on my blog? What would you like to see?

I am planning on blogging more and feedback would be great about the direction you would like me to go, or the content you enjoy seeing or what you do not want to see.

Taking Screenshots of WPF Apps

In my current project, we have quite an awesome UI automation setup running through every process (happy days path) in our WPF app.

Often we cannot resolve a UI element, and we will get an error like:

White.Core.AutomationException: Failed to get UIElement ControlType=button,AutomationId=OkButton from DialogWindow

While this is great, often it is hard to figure out why this happens, could be due to a validation error on the previous screen, or a error popup etc. So out infrastructure will automatically take a screenshot whenever it catches a AutomationException.

The problem is the modal window that was often captured (and was blocking a button press on the main window) was coming out as a tiny little square with no contents: