You can achieve this by using an Enum with the default values you want and then creating a property of this Enum type in your class with a default value set.
Here is an example:
main.cs161 chars12 lines
Now you can use the MyClass
and set the MyProperty
to one of the three pre-defined values of MyPropertyType
enumeration or simply use the default value.
main.cs168 chars5 lines
gistlibby LogSnag