C.3 Naming C enums


C.3 Naming C# enums

Use Pascal casing for both enum identifiers and enum value names . For example:

 enum Day {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; 

It is not recommended to add Enum after the enum identifier. In the case above, Day would be more appropriate than DayEnum .

Enum names should be singular “ Day is preferable to Days (it is obvious that an enum type will represent multiple items).



From Java to C#. A Developers Guide
From Java to C#: A Developers Guide
ISBN: 0321136225
EAN: 2147483647
Year: 2003
Pages: 221
Authors: Heng Ngee Mok

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net