diff --git a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs index 143fd98..c0c4ae8 100644 --- a/ICD.Common.Utils/Extensions/ReflectionExtensions.cs +++ b/ICD.Common.Utils/Extensions/ReflectionExtensions.cs @@ -129,6 +129,38 @@ namespace ICD.Common.Utils.Extensions } #endif +#if SIMPLSHARP + /// + /// Returns the value of the property + /// Only needed for SIMPLSHARP since newer .Net contains this already + /// + /// + /// + /// The property value for the obj parameter. + public static object GetValue([NotNull] this PropertyInfo extends, object obj) + { + if (extends == null) + throw new ArgumentNullException("extends"); + + return extends.GetValue(obj, null); + } + + /// + /// Sets the value of the property + /// Only needed for SIMPLSHARP since newer .Net contains this already + /// + /// + /// + /// + public static void SetValue([NotNull] this PropertyInfo extends, object obj, object value) + { + if (extends == null) + throw new ArgumentNullException("extends"); + + extends.SetValue(obj, value, null); + } +#endif + /// /// Sets the value of a property /// Traverses the path to access properties nested in other properties