Exemplo n.º 1
0
 private static bool IsMatched(MethodBase resolved, MethodBase method, AutoGenericType autoGenericType)
 {
     return(resolved.Name == method.Name &&
            resolved.GetParameters()
            .Select(pi => pi.ParameterType)
            .SequenceEqual(autoGenericType.ResolveUnclosedParameterTypes(method.GetParameters())));
 }
Exemplo n.º 2
0
 private static bool IsMatched(MethodBase resolved, MethodBase method, AutoGenericType autoGenericType)
 {
     return(string.Equals(resolved.Name, method.Name, StringComparison.Ordinal) &&
            resolved.GetParameters()
            .Select(pi => pi.ParameterType)
            .SequenceEqual(autoGenericType.ResolveUnclosedParameterTypes(method.GetParameters())));
 }
Exemplo n.º 3
0
        private MethodBase ResolveUnclosedGenericType(
            MethodBase method, Func <Type, IEnumerable <MethodBase> > methodSetToMatch)
        {
            if (!method.ReflectedType.ContainsGenericParameters)
            {
                return(method);
            }

            var autoGenericType = new AutoGenericType(this.Builder, method.ReflectedType);

            return(methodSetToMatch(autoGenericType.Value).Single(c => IsMatched(c, method, autoGenericType)));
        }