Example #1
0
        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()));
        }
Example #2
0
        internal static MissingConstructorException Create <TSignature>()
            where TSignature : Delegate
        {
            var invokeMethod = DelegateType.GetInvokeMethod <TSignature>();

            return(new MissingConstructorException(invokeMethod.ReturnType, invokeMethod.GetParameterTypes()));
        }
Example #3
0
        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));
 }
Example #5
0
 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));
 }