Sep 22, 2011 8:28 PM
I hate opening up a source file and seeing that. No, not the VB.NET, though I’m not a fan of that either. I mean the fifteen region directives in a 312 line file. Most of those have one method in them. I guess at some point that was a coding standard or something - but dude, you’re making the code harder to read, not easier.
Neither Visual Studio nor resharper has a direct means of quickly removing individual region directives, though resharper can be configured to remove all of them when you reformat the file.
To remove specific regions, follow these steps:
Type Ctrl+Alt+F to display resharper’s File Structure window, shown below. The gray outlines correspond to regions.
Click the ‘x’ in the upper right corner of the region box. The start and end region directives will be removed, but the code they contain will remain.