When the editor caret is on the line with a region directive, you can press the Space key to collapse or expand the outline of a region. There are built-in shortcuts for toggling outline expansion, but they are probably more tricky to press and remember, e.g. “Ctrl+M, M” (hold the Control key and press the M key twice in the Visual C# keyboard mapping scheme).

Read more…
This simple code provider, as the name says, removes the two lines of region directives:
- #region and #endregion lines in CSharp
- #Region and #End Region lines in Visual Basic
- #pragma region and #pragma endregion lines in C++
It is available on any of the two directives – either starting or ending:
Read more…
If you prefer your code to be wrapped into region directives (#region … #endregion in CSharp, or #Region … #End Region in Visual Basic), the Auto Create Region feature from CodeRush will help. To create a named region around a method, property or event, press “Ctrl+3” key anywhere inside of an active member. This will execute the “RegionAutoCreate” action, which wraps the active member into region directives. The region name will be the same as member’s name and will wrap all attached elements, such as XML doc comments or attributes as well.
Read more…
Cause:
This code issue shows an error if a ‘try’ statement doesn’t have a ‘catch’ or ‘finally’ statement. The try block must be completed, whether with catch or finally blocks.
The try block contains the guarded code that may cause the exception. The block is executed until an exception is thrown or it is completed successfully.
Read more…
Cause:
A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. Parameters are not allowed for static constructors.
Read more…
This code issue shows an error when the structure is derived from a non-interface type. Structures can only inherit from other interfaces according to various language specifications.
Read more…
Cause:
This code issue shows a dead code when there are unreferenced private property setters. Unused property setters of private properties can be safely removed, which will improve code readability.
Sample:

How to fix:
- Apply the Remove Setter code fix:

—–
Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: any
Updated: Nov/12/2012
ID: C054
Cause:
This code issue shows a hint (suggestion) that a redundant constructor can be safely removed. Redundant constructor is a public, parameterless constructors without any code inside of its body. This constructor doesn’t call base type constructors and it is alone in the current class. The constructor is redundant because such constructors are automatically generated by the compiler. Removing the redundant constructors may improve code readability.
Sample:

How to fix:
- Remove the redundant constructor by applying the corresponding Remove Redundant Constructor refactoring:

- Add another constructor to the class, so the original constructor is no longer redundant:

Also, see the full list of code issues specific to constructors.
—–
Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: any
Updated: Nov/12/2012
ID: C053