.NET: What attribute would you use to describe an Enum value? -


lets have enum:

public enum applicationstatus     <foo("active")> active = 1     <foo("inactive")> inactive = 2     <foo("retired")> retired = 3     <foo("in development")> indevelopment = 4 end enum 

what attribute should use in place of foo plain-text descriptions of enum?

i've used description mine, in cases when enumeration needs display differently, otherwise displays string of enum value.

i've use method checks case of each character in enum item , if it's uppercase character after 1st, adds space before character.

public enum applicationstatus     active = 1     inactive = 2     retired = 3     indevelopment = 4     <description("radical display name")> radical = 5  end enum 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -