Recently, I have been on a fix with Visual Studio eXtensibility (VSX), and have been experimenting with Visual Studio automation. Extensibility is one of the pillars of Visual Studio, and there are so many things you can do. Once you get a handle on it, the possibilities are unlimited.
Or are they? My last post mentioned a problem, two actually, that I encountered while trying to create a debugger visualizer for the 'System.__ComObject' type. Here is another Visual Studio add-in I attempted to build without success:
Source Control Switcher
To change the source control provider in Visual Studio, you have to navigate to the Tools menu and choose 'Options…'. Then select 'Source Control' from the TreeView and find the desired provider in the dropdown. What a pain. I have source control set up at home for my projects, a couple CodePlex projects, and a work source control environment to switch between. I thought it would be wonderful to have a dropdown in a toolbar to allow me to switch source control providers.
Unfortunately, there are no hooks in the add-in model to allow for this. There is a DTE.SourceControl object, but it only allows for working within the currently selected source control provider. For those familiar with the add-in model, there is also an option to use EnvDTE.Properties("", ""), but it cannot be used to access the Source Control properties.
I found some tools out there to do this – sorta. They all use the registry and require you to close and re-open Visual Studio. Not an ideal solution.
I may have to move this project up a notch to tier 3 and see if this is possible with the Managed Package Framework/Visual Studio SDK. I found a IVsSccToolsOptions interface in the MPF, maybe that will work? We'll give it a go.
Isn't pushing the envelope fun? Speaking of envelope, I may need some SOAP after all this getting down and dirty.