/// <summary> /// Cast a delegate from one type to another. Compatible with delegates holding an invocation list (combined delegates). /// </summary> /// <param name="source">The input delegate.</param> /// <returns>The output delegate.</returns> public static T CastDelegate <T>(this Delegate source) where T : class => source.CastDelegate(typeof(T)) as T;
public void Modify(Delegate hookDelegate) { _Add(_NewILHook, hookDelegate.CastDelegate <ILContext.Manipulator>()); }