diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs index cee991507..3b344ce56 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs @@ -126,7 +126,11 @@ namespace Tango.Core.ExtensionMethods var desProp = destination.GetType().GetProperty(prop.Name, BindingFlags.Public | BindingFlags.Instance); - if (desProp != null && desProp.PropertyType == prop.PropertyType && desProp.SetMethod != null) + if (desProp != null && desProp.SetMethod != null && desProp.PropertyType.IsEnum && prop.PropertyType.IsEnum) + { + desProp.SetValue(destination, Enum.Parse(desProp.PropertyType, value.ToString())); + } + else if (desProp != null && desProp.PropertyType == prop.PropertyType && desProp.SetMethod != null) { desProp.SetValue(destination, value); } |
