Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.24 KB

SA1109.md

File metadata and controls

52 lines (39 loc) · 1.24 KB

SA1109

TypeName SA1109BlockStatementsMustNotContainEmbeddedRegions
CheckId SA1109
Category Readability Rules

⚠️ This rule has been intentionally omitted from StyleCop Analyzers. See KnownChanges.md for additional information.

Cause

A C# statement contains a region tag between the declaration of the statement and the opening brace 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 brace. 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.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1109:BlockStatementsMustNotContainEmbeddedRegions", Justification = "Reviewed.")]
#pragma warning disable SA1109 // BlockStatementsMustNotContainEmbeddedRegions
#pragma warning restore SA1109 // BlockStatementsMustNotContainEmbeddedRegions