-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Naming.DoNotUseReservedInEnumValueNamesRule(2.10)
Sebastien Pouliot edited this page Feb 9, 2011
·
3 revisions
Assembly: Gendarme.Rules.Naming
Version: 2.10
This rule checks for enumerations that contain values named reserved. This practice, often seen in C/C++ sources, is not needed in .NET since adding new values will not normally break binary compatibility. However renaming a reserved enum value can since there is no way to prevent people from using the old value.
Bad example:
public enum Answer {
Yes,
No,
Reserved
// ^ renaming this to 'Maybe' would be a breaking change
}
Good example:
public enum Answer {
Yes,
No
// we can add Maybe here without causing a breaking change
// (but note that we may break code if we change the values of
// existing enumerations)
}
Note that this page was autogenerated (3/17/2011 9:31:58 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!