internal static MissingMethodException Create <T, TSignature>(string methodName) where TSignature : Delegate { var invokeMethod = DelegateType.GetInvokeMethod <TSignature>(); return(new MissingMethodException(typeof(T), methodName, invokeMethod.ReturnType, invokeMethod.GetParameterTypes())); }
internal static MissingConstructorException Create <TSignature>() where TSignature : Delegate { var invokeMethod = DelegateType.GetInvokeMethod <TSignature>(); return(new MissingConstructorException(invokeMethod.ReturnType, invokeMethod.GetParameterTypes())); }
public static void DelegateSignature() { var signature = DelegateType.GetInvokeMethod <Func <int, string> >(); NotNull(signature); Equal(typeof(int), signature.GetParameters()[0].ParameterType); Equal(typeof(string), signature.ReturnParameter.ParameterType); }
internal static MissingConstructorException Create <TSignature>() where TSignature : Delegate { var(parameters, target) = DelegateType.GetInvokeMethod <TSignature>().Decompose(method => method.GetParameterTypes(), method => method.ReturnType); return(new MissingConstructorException(target, parameters)); }
internal static MissingMethodException Create <T, D>(string methodName) where D : Delegate { var(parameters, returnType) = DelegateType.GetInvokeMethod <D>().Decompose(method => method.GetParameterTypes(), method => method.ReturnType); return(new MissingMethodException(typeof(T), methodName, returnType, parameters)); }