Lua forms.setproperty: Convert the passed value to an enum if applicable

This commit is contained in:
pjgat09 2015-12-19 00:01:06 -05:00
parent f8a3dca089
commit d54e53d329
1 changed files with 8 additions and 0 deletions

View File

@ -482,6 +482,10 @@ namespace BizHawk.Client.EmuHawk
{
if (form.Handle == ptr)
{
if (form.GetType().GetProperty(property).PropertyType.IsEnum)
{
value = Enum.Parse(form.GetType().GetProperty(property).PropertyType, value.ToString(), true);
}
form
.GetType()
.GetProperty(property)
@ -493,6 +497,10 @@ namespace BizHawk.Client.EmuHawk
{
if (control.Handle == ptr)
{
if (control.GetType().GetProperty(property).PropertyType.IsEnum)
{
value = Enum.Parse(control.GetType().GetProperty(property).PropertyType, value.ToString(), true);
}
control
.GetType()
.GetProperty(property)