diff --git a/ICD.Common.Utils/ReflectionUtils.cs b/ICD.Common.Utils/ReflectionUtils.cs
index 66d921a..bf422fb 100644
--- a/ICD.Common.Utils/ReflectionUtils.cs
+++ b/ICD.Common.Utils/ReflectionUtils.cs
@@ -31,15 +31,14 @@ namespace ICD.Common.Utils
if (type == null)
throw new ArgumentNullException("type");
+ ConstructorInfo constructor =
#if SIMPLSHARP
- CType[] types = values.Select(v => (CType)v.GetType())
- .ToArray();
- ConstructorInfo constructor = ((CType)type).GetConstructor(types);
+ ((CType)type)
#else
- Type[] types = values.Select(v => v.GetType())
- .ToArray();
- ConstructorInfo constructor = type.GetTypeInfo().GetConstructor(types);
+ type
#endif
+ .GetConstructors()
+ .FirstOrDefault(c => MatchesConstructorParameters(c, values));
try
{
@@ -55,6 +54,29 @@ namespace ICD.Common.Utils
throw new InvalidOperationException(message);
}
+ ///
+ /// Returns true if the parameters match the constructor parameters.
+ ///
+ ///
+ ///
+ ///
+ public static bool MatchesConstructorParameters(ConstructorInfo constructor, IEnumerable