views:

38

answers:

2

I'd like the regions that show up in my visual studio window to be open by default when I open a code file. Is this possible in VS2010, or is there an extension that will do that for me?

Barring that, is my request a thing that be written in an extension?

+1  A: 

If you would like Regions turned off, right click any code window, choose Outlining, then Stop Outlining.

Daniel A. White
this kind of works, but I was hoping for a more permanent, global solution.
thepaulpage
+1  A: 

you could write a macro that calls the Visual Studio Command Edit.StopOutlining for you every time you are opening a document.

This MSDN Page describes how to write a basic macro that handles events: http://msdn.microsoft.com/en-us/library/ee1f34as.aspx Instead of handle the WindowClosing you should handle WindowActivated.

Like this:

Public Sub windowopen(ByVal window As EnvDTE.Window, ByVal lostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated
    DTE.ExecuteCommand("Edit.StopOutlining")
End Sub

Of course, this will call Edit.StopOutlining on every window you are opening; so maybe you have to do a little bit of filtering what documenttype was activated.

Noffls
I suppose if I can't just flip a bit in the preferences, this will have to do.
thepaulpage