src/Mimp.SeeSharper.Reflection/MethodInfoExtensions.cs
/// <summary>
/// Return a delegate to invoke the method with the instance and a array of parameters.
/// </summary>
/// <typeparam name="TDelegate"></typeparam>
/// <param name="method"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
/// <exception cref="ArgumentException">If the delegate has no parameter for instance and the parameters.</exception>
/// <exception cref="InvalidOperationException">If the return type or instance type isn't castable to the delegate types.</exception>
Return a delegate to invoke the method with the instance and a array of parameters.
Return a delegate to invoke the method with the instance and a array of parameters .
public static TDelegate GetInstanceParameterDelegate<TDelegate>(this MethodInfo method) where TDelegate : Delegate
        {
            if (method is null)
                throw new ArgumentNullException(nameof(method));
            return (TDelegate)method.GetInstanceParameterDelegate(typeof(TDelegate));
        }
public static TDelegate GetInstanceParameterDelegate < TDelegate > ( this MethodInfo method ) where TDelegate : Delegate { if ( method is null ) throw new ArgumentNullException ( nameof ( method ) ) ; return ( TDelegate ) method . GetInstanceParameterDelegate ( typeof ( TDelegate ) ) ; }
Return a delegate to invoke the method with the instance and a array of parameters.
Return a delegate to invoke the method with the instance and a array of parameters .
None
None
If the delegate has no parameter for instance and the parameters.
If the delegate has no parameter for instance and the parameters .
If the return type or instance type isn't castable to the delegate types.
If the return type or instance type isn ' t castable to the delegate types .
MethodInfo
this
method
None
typeparam
None