Enumeration has fields that aren't userfriendly, possible to attachedmeta data to them?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DotNetNewbie

    #1

    Enumeration has fields that aren't userfriendly, possible to attachedmeta data to them?

    Hi,

    I am creating the administration side of a web application, and I want
    to basically enumerate through a Enumerations items and display the
    enum items name and value.

    Problem is the name of each item is not user friendly, is it possibel
    for me to attach some kind of meta deta that I could access via
    reflection?

    example:

    public enum SomeEnum
    {
    BrownColor = 1,
    GreenColor = 2
    }

    Since 'browncolor' and 'greencolor' is not written properly (I would
    like "brown color"), is there any kind of meta data I could add?

    Like:

    public enum SomeEnum
    {
    ["Brown Color"]
    BrownColr = 2

    }

    Possible?
Working...