S
Simon Dahlbacka
Hi,
I have an occasion where it would be useful to add attributes to
individual enum members, and I can do that very well enough, the
problem is: how do I access them "after the fact"?
the obvious
Thing foo = Thing.Bar;
object[] attrs = foo.GetType().GetCustomAttributes(false);
does not work for obvious reasons..
Do I have to rethink my approach to the problem (i.e. skip the use of
attributes on enum members), or is there a way to make it work?
I have an occasion where it would be useful to add attributes to
individual enum members, and I can do that very well enough, the
problem is: how do I access them "after the fact"?
the obvious
Thing foo = Thing.Bar;
object[] attrs = foo.GetType().GetCustomAttributes(false);
does not work for obvious reasons..
Do I have to rethink my approach to the problem (i.e. skip the use of
attributes on enum members), or is there a way to make it work?