Better support for enums

This commit is contained in:
Deukhoofd 2018-12-13 21:18:12 +01:00
parent 07043e1ab4
commit b2f31490bc
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 15 additions and 0 deletions

View File

@ -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