Visual Studio Tip: No Regions Around Implemented Interfaces
One of the (many) useful features of Visual Studio is the Implement Interface. With it, if you declare a class as implementing a particular interface, you can have Visual Studio generate stubs for all the methods declared by that interface.
With default settings, Visual Studio will place regions around the stubs that it just generated:
As you may know from previous posts, I am not a fan of using regions within C# code. I tend to favor lean classes and short methods, I find regions almost useless; worse, they tend to visually clutter the code.
Luckily, there’s a way to configure Visual Studio not to put regions around implemented interfaces. It’s buried under Tools->Options->Text Editor->C#->Advanced. Simply uncheck the “Surround generated code with #region” in the “Implement interface” group:
VoilĂ . You now have all your stubs ready to be implemented, without those annoying regions around:








