I'd like to use a small array of strings in the same way I use Enums. I'd like to
- Limit the possible property values to these preset options
- Have intelisence display those options
- Share this 'OptionList' with other objects in my project
Here's what I currently have:
public enum StatusOptions
{
OptionOk = 1, OptionDisabled = 0
}
public class User()
{
public StatusOptions Status { get; set; }
}
Here's what I'd like to do - but can't because Enums are limited to int
public string[] StatusOptions
{
"ok", "disabled"
}
public class User()
{
public StatusOptions Status { get; set; }
}
What is the Best way of doing this?