From 091a4bdeb2feadb4962c6be5deb367ab56d81707 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 30 Mar 2020 00:56:02 +0300 Subject: Implemented PPC Updates & Packages. Moved PPC/FSE interfaces to PPC.Shared. Changes Generic Serialization to json. --- .../Visual_Studio/Tango.Core/ExtensionMethods/ObjectExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods') 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); } -- cgit v1.3.1