From c6b2cd78cc2c339df492d9cc67f3589ba2eb6d3d Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Tue, 14 Jul 2020 13:25:29 -0400 Subject: [PATCH] fix: fixing 2008 compatibiltiy issues --- ICD.Common.Utils/Extensions/ReflectionExtensions.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs index 532c96e..143fd98 100644 --- a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs +++ b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs @@ -186,9 +186,9 @@ namespace ICD.Common.Utils.Extensions public static PropertyInfo GetPropertyInfo([NotNull] this object extends, [NotNull] params string[] path) { if (extends == null) - throw new ArgumentNullException(nameof(extends)); + throw new ArgumentNullException("extends"); if (path == null) - throw new ArgumentNullException(nameof(path)); + throw new ArgumentNullException("path"); object currentObject = extends; @@ -202,11 +202,15 @@ namespace ICD.Common.Utils.Extensions .GetProperty(path[i]); if (info == null) return null; - currentObject = info.GetValue(currentObject); + currentObject = info.GetValue(currentObject, null); } //Set the property to the value - return currentObject.GetType().GetProperty(path[path.Length - 1]); + return currentObject.GetType() +#if SIMPLSHARP + .GetCType() +#endif + .GetProperty(path[path.Length - 1]); } ///