Exemplo n.º 1
0
        public static bool MatchParameters(ParameterInfo[] firstParameters, ParameterInfo[] secondParameters)
        {
            if (firstParameters.Length != secondParameters.Length) {
                return false;
            }

            return firstParameters.All((p, i) => {
                return MatchParameter(p, secondParameters[i]);
            });
        }
 private static bool IsValidCommandHandler(Type commandType, MethodInfo method, ParameterInfo[] parameters, MethodParameterInjector injector)
 {
     if (method.DeclaringType != null && method.DeclaringType.GetProperties().Any(p => IsPropertyAccessor(method, p)))
         return false;
     return parameters.Any(p => p.ParameterType == commandType)
            && parameters.All(p => p.ParameterType == commandType || injector.CanSupply(p.ParameterType));
 }
Exemplo n.º 3
0
        private static bool ValidateParameters(ParameterInfo[] methodParameters, Type[] comparedTypes)
        {
            return methodParameters.Length == comparedTypes.Length &&
                   methodParameters.All((p, i) => {
                       var parameterType = p.ParameterType;

                       if (parameterType.IsByRef) {
                           parameterType = parameterType.GetElementType();
                       }

                       return ReferenceEquals(parameterType, comparedTypes[i]);
                   });
        }