Thankfully, here's a very useful post of links to all sorts of Enum-related info
Enums + Attributes = Swiss Army Knife
And a very useful sample lives here Associating string values to items in code with code.
Decorating Enums with string attributes sounds like it could be used to solve two ongoing problems:
- localizing(translating) the meaning of an Enum for display to a user, maybe using some sort of 'translation key' attribute; and
- linking the Enum type to some underlying database lookup table to which it is related...
No comments:
Post a Comment
Note: only a member of this blog may post a comment.