Permalink
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (29 sloc) 925 Bytes

SA1214

TypeName SA1214ReadonlyElementsMustAppearBeforeNonReadonlyElements
CheckId SA1214
Category Ordering Rules

Cause

A readonly field is positioned beneath a non-readonly field.

Rule description

A violation of this rule occurs when a readonly field is positioned beneath a non-readonly field.

How to fix violations

To fix an instance of this violation, place all readonly fields above all non-readonly fields.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1214:ReadonlyElementsMustAppearBeforeNonReadonlyElements", Justification = "Reviewed.")]
#pragma warning disable SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements
#pragma warning restore SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements