TypeName | SA1207ProtectedMustComeBeforeInternal |
CheckId | SA1207 |
Category | Ordering Rules |
The keyword protected is positioned after the keyword internal within the declaration of a protected internal C# element, or the keyword private is positioned after the keyword protected.
A violation of this rule occurs when a protected internal element's access modifiers are written as internal protected, or when a private protected element's access modifiers are written as protected private. In reality, an element with the keywords protected internal will have the same access level as an element with the keywords internal protected. To make the code easier to read and more consistent, StyleCop standardizes the ordering of these keywords, so that a protected internal element will always be described as such, and never as internal protected. This can help to reduce confusion about whether these access levels are indeed the same.
To fix an instance of this violation, place the protected keyword before the internal keyword, or place the private keyword before the protected keyword.
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1207:ProtectedMustComeBeforeInternal", Justification = "Reviewed.")]
#pragma warning disable SA1207 // ProtectedMustComeBeforeInternal
#pragma warning restore SA1207 // ProtectedMustComeBeforeInternal