Are you doing both?
In any case, I would rather solve it with a generator than dynamic code.
Seems like overkill to me. Most enums have a hand full of values.
I agree, a generator is the way to do this. At the moment, I don't
allow free-form entry of values that are part of an enum, so access is
only by combo-box / selection list etc so the user can only choose a
valid value .
On 16 March 2010 22:00, Thomas Mercer-Hursh
Admittedly not a major labor saver, but it certainly takes less time to provide the list of values and press a button than it does to type all the options.
Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice http://www.cintegrity.com
Depends on your level of trust.
MyClass:EnumProperty = MyEnum.SomeValue
is very safe, but
MyClass.EnumProperty = something from a combo box which I am presuming was populated with the possible enum values
is less safe.
True. That's why there is a validator method.
On 16 March 2010 22:21, Thomas Mercer-Hursh