Easy Enum property for EPiServer
One of the most frequently and eagerly used programming constructs of the Microsoft.Net Framework is Enum. There are several interesting features that make it very compelling to use to for all kinds of dropdowns and checklists:
- The bounds factor – proper use of Enum type guarantee that the selected value will fall within the constraints of the allowed value set.
- The ability to treat Enums as flags (and compound them into flag sets) as well as a one-of selector.
- The ease of use and potentially complete separation of the ?Enum value? from the underlying machine type representation that ensures the most efficient memory usage.
Surprisingly enough EPiServer as it stands right now does not have an easy facility to turn Enums into properties. To give credit where credit is due, the EPiServer framework provides a nice surrogate that mimic that behaviour to a degree. The relevant property types are: