VS Macro / Shortcuts to Expand / Collapse all regions
Using regions in code to break up and make it easy to look at seems to becoming more popular.
I have to admit I have a love / hate relationship with regions because sometimes they just get in the way.
Ran across a post from Roland Weigelt where he has a macro that helps expand / collapse all the regions in a source file.
Here’s the link to the post Better Keyboard Support for #region ... #endregion
Roy Osherove also provided the following key strokes that are built into Visual Studio:
CTRL+M CTRL+M (that's two key presses!) - collapse/open the current parent region
CTRL+M CTRL+L - Collapse/Open all regions in document recursively (meaning you might get only one line in the document - one big namespace region which is collapsed or you'll see the entire page code uncollapsed
CTRL+M CTRL+O - Collapse all regions not recursively -
Thanks Roland and Roy!