Better support for enums
This commit is contained in:
parent
07043e1ab4
commit
b2f31490bc
|
@ -124,6 +124,21 @@ namespace Upsilon.BoundTypes
|
|||
});
|
||||
}
|
||||
}
|
||||
public UserDataBoundEnumDefinition(IEnumerable<string> values, string name) : base(name, new Dictionary<string, UserDataBoundProperty>())
|
||||
{
|
||||
Properties = new Dictionary<string, UserDataBoundProperty>();
|
||||
Name = name;
|
||||
|
||||
foreach (var value in values)
|
||||
{
|
||||
var valueName = value.ToString().ToLowerInvariant();
|
||||
Properties.Add(valueName, new UserDataBoundProperty()
|
||||
{
|
||||
Name = valueName,
|
||||
Type = Type.Number
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class UserDataBoundProperty
|
||||
|
|
Loading…
Reference in New Issue