views:

496

answers:

2

When user the "Implement Inteface X" context menu feature, the inserted code gets surrounded by a

#region [interfacename] Members
#endregion

pair. I always end up deleting this, is there a way I can permanently turn it off? I had a quick search through the snippets directory, but wasn't sure if this was the right place. There's pp_region.snippet that I guess I could modify, but I got the feeling that would turn off the #region/#endregion completely. I thought I'd ask here before I go doing things that will have me re-installing VS...

+33  A: 

You can turn it off via Tools / Options

Then, in the option-window, you select 'Text Editor', then the language of your choice (C# for ex). Then, you select 'Advanced', and then, you have a checkbox which says: 'Surround generated code with #region'

Frederik Gheysels
Good one, thanks!
Brian Rasmussen
Thank you, thank you, thank you! Can't tell you how annoying this is!
Dmitri Nesteruk
Excellent answer!
Andrei Rinea
+1 this thing has been annoying me for ages!
DrJokepu
+1  A: 

Also, if you're using Resharper you can fully configure the layout of your classes so they'll look exactly the way you want. One of the options is to completely remove the region tags whenever it finds any. It's awesome to open any c# project and have it reformatted just by doing [CTRL+E, C]

Trap
Sorry, but I cannot bear Resharper. One day I'll be able to install it and it won't: remap all my keybindings and refuse to set them back; screw up all the Intellisense and refuse to change it back; make my machine run like a dog and refuse to uninstall. I'm not a fan :-)
endian