You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The keyword <c>protected</c> is positioned after the keyword <c>internal</c> within the declaration of a
14
-
/// protected internal C# element.
14
+
/// protected internal C# element, or the keyword <c>private</c> is positioned after the keyword <c>protected</c>.
15
15
/// </summary>
16
16
/// <remarks>
17
17
/// <para>A violation of this rule occurs when a protected internal element's access modifiers are written as
18
-
/// <c>internal protected</c>. In reality, an element with the keywords <c>protected internal</c> will have the same
18
+
/// <c>internal protected</c>, or when a private protected element's access modifiers are written as
19
+
/// <c>protected private</c>. In reality, an element with the keywords <c>protected internal</c> will have the same
19
20
/// access level as an element with the keywords <c>internal protected</c>. To make the code easier to read and more
20
21
/// consistent, StyleCop standardizes the ordering of these keywords, so that a protected internal element will
21
22
/// always be described as such, and never as internal protected. This can help to reduce confusion about whether
@@ -29,8 +30,8 @@ internal class SA1207ProtectedMustComeBeforeInternal : DiagnosticAnalyzer
29
30
/// </summary>
30
31
publicconststringDiagnosticId="SA1207";
31
32
privateconststringTitle="Protected should come before internal";
32
-
privateconststringMessageFormat="The keyword 'protected' should come before 'internal'.";
33
-
privateconststringDescription="The keyword 'protected' is positioned after the keyword 'internal' within the declaration of a protected internal C# element.";
33
+
privateconststringMessageFormat="The keyword '{0}' should come before '{1}'.";
34
+
privateconststringDescription="The keyword '{0}' is positioned after the keyword '{1}' within the declaration of a {0} {1} C# element.";
Copy file name to clipboardExpand all lines: documentation/SA1207.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,15 @@
17
17
18
18
## Cause
19
19
20
-
The keyword *protected* is positioned after the keyword *internal* within the declaration of a protected internal C# element.
20
+
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*.
21
21
22
22
## Rule description
23
23
24
-
A violation of this rule occurs when a protected internal element's access modifiers are written as *internal protected*. 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.
24
+
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.
25
25
26
26
## How to fix violations
27
27
28
-
To fix an instance of this violation, place the *protected* keyword before the *internal* keyword.
28
+
To fix an instance of this violation, place the *protected* keyword before the *internal* keyword, or place the *private* keyword before the *protected* keyword.
0 commit comments