protected virtual void UpdateOptions()
{
var options = new List<Option>();
if (!IsRequired && Type != DataTypes.Enum)
options.Add(new Option(null, string.Empty));
if (Type == DataTypes.NullableBoolean)
{
options.Add(new Option("True", Service.Current.Messages["True"]));
options.Add(new Option("False", Service.Current.Messages["False"]));
}
else if (Type == DataTypes.DropDown || Type == DataTypes.Enum || Type == DataTypes.ComboBox)
{
var optionsDirect = OptionsDirect ?? new string[0];
optionsDirect.Run(o => options.Add(new Option(o, o)));
}
else if (Type == DataTypes.KeyValueList && OptionsDirect != null)
options.AddRange(OptionsDirect.Select(o => o.Split(new[] { '=' }, 2)).Select(p => new Option(p[0], p[1])));
Options = options.ToArray();
}