Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Readability Rules >

SA1109: BlockStatementsMustNotContainEmbeddedRegions

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1109: BlockStatementsMustNotContainEmbeddedRegions
Glossary Item Box
TypeName

BlockStatementsMustNotContainEmbeddedRegions

CheckId

SA1109

Category

Readability Rules

 

Cause

A C# statement contains a region tag between the declaration of the statement and the opening curly bracket of the statement.

Rule Description

A violation of this rule occurs when the code contains a region tag in between the declaration and the opening curly bracket. For example:

  if (x != y)

   #region

   {

   }

   #endregion

 

This will result in the body of the statement being hidden when the region is collapsed.

How to Fix Violations

To fix a violation of this rule, remove the region or move it outside of the statement.

 


© Microsoft Corporation. All Rights Reserved.