Skip to content

Gendarme.Rules.Naming.UseSingularNameInEnumsUnlessAreFlagsRule(2.10)

Sebastien Pouliot edited this page Feb 9, 2011 · 3 revisions

UseSingularNameInEnumsUnlessAreFlagsRule

Assembly: Gendarme.Rules.Naming
Version: 2.10

Description

The rule is used for ensure that the name of enumerations are in singular form unless the enumeration is used as flags, i.e. decorated with the Flags attribute.

Examples

Bad example:

public enum MyCustomValues {
    Foo,
    Bar
}

Good example (singular):

public enum MyCustomValue {
    Foo,
    Bar
}

Good example (flags):

[Flags]
public enum MyCustomValues {
    Foo,
    Bar,
    AllValues = Foo | Bar
}
Clone this wiki locally