I would like to know if it is possible to get attributes of the enum
values and not of the enum
itself? For example, suppose I have the following <
Alternatively, you could do the following:
Dictionary description = new Dictionary()
{
{ FunkyAttributesEnum.NameWithoutSpaces1, "Name With Spaces1" },
{ FunkyAttributesEnum.NameWithoutSpaces2, "Name With Spaces2" },
};
And get the description with the following:
string s = description[FunkyAttributesEnum.NameWithoutSpaces1];
In my opinion this is a more efficient way of doing what you want to accomplish, as no reflection is needed..