I have an enum that has different colors in it. I would like to pass some function an int and have it return the color name that is in the enum in that position.
What's the way to do this?
I have an enum that has different colors in it. I would like to pass some function an int and have it return the color name that is in the enum in that position.
What's the way to do this?
((YourEnum)Value).ToString()
For eg.
((MyEnum)2).ToString()
Note: Points to remember, your enum should be decorated by [Flag] and enum value must be greater than 0.