feat: shim for platform independent delegate creation

This commit is contained in:
Chris Cameron
2018-04-09 15:24:22 -04:00
parent 27f5fd0fe7
commit 7ab06fdb94

View File

@@ -387,5 +387,23 @@ namespace ICD.Common.Utils
return Convert.ChangeType(value, type, null);
}
/// <summary>
/// Platform independant delegate instantiation.
/// </summary>
/// <param name="type"></param>
/// <param name="firstArgument"></param>
/// <param name="method"></param>
/// <returns></returns>
public static Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method)
{
return
#if SIMPLSHARP
CDelegate
#else
Delegate
#endif
.CreateDelegate(type, firstArgument, method);
}
}
}