JMarsch
JMarsch

Reputation: 21753

Add-in to set TFS options

I would like to write a quick macro or add-in to allow me to quickly toggle the "Show Deleted Items" option in the TFS Solution explorer.

I cannot seem to find the proper command to use to set that option programmatically (in the IDE, it is found at Tools | Options | Source Control | Visual Studio Team Foundation Server | Show deleted items in the Source Control Explorer).

Can anyone give me some pointers as to where to look? I have installed the Visual Studio SDK, but the documentation seems to be incomplete -- I have documentation for the TeamFoundationServer object, but none of the others (like the VersionControl class), so I've been poking around with intellisense, and not having much luck.

Upvotes: 1

Views: 223

Answers (3)

Martin Woodward
Martin Woodward

Reputation: 11770

Sounds like you are wanting to write an add-in to Visual Studio to quickly affect this behavior rather than going to the preference each time.

I don't think this is exposed via the TFS object model in a publicly accessible class. It appears that this preference is ultimately stored in the registry key in HKCU\Software\Microsoft\VisualStudio\9.0\TeamFoundation\SourceControl - however the preference appears to be cached in memory in the running application - meaning that if you set the registry key directly then you'd have to restart Visual Studio to get it to pick up the preference.

Often preferences like this are implemented using an internal "Settings" style class that the preference dialog page would have access to along with the things using the setting (such as the Source Control Explorer). As the preference dialog and the thing using the preference are usually contributed into Visual Studio by the same assembly then both could see an internal class that you'd only have access to by using reflection or something nasty like that.

Upvotes: 1

Related Questions