Lets seay I have this enum type:
public enum MyEnum { [EnumDisplayValue("This is Value 1")] value1 = 1, [EnumDisplayValue("This is Value 2")] value2 = 2 }
Now consider this code:
MyEnum myEnum = MyEnum.value2;MessageBox.Show(myEnum.ToString());
The messagebox displays "value2", but I would like to see EnumDisplayValue "This is Value 2".
Is there an easy way to get the value of that attribute? I have a feeling I need to use reflections to get it.
Thank you for your help.