mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
feat: shim for platform independent delegate creation
This commit is contained in:
parent
27f5fd0fe7
commit
7ab06fdb94
1 changed files with 18 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue