private GetParameterType ( IGenericBinder binder, int index ) : Type | ||
binder | IGenericBinder | |
index | int | |
return | Type |
private static List <CustomAttributeTypedArgument> WrapConstructorArgs(object[] args, MethodSignature sig) { List <CustomAttributeTypedArgument> list = new List <CustomAttributeTypedArgument>(); for (int i = 0; i < args.Length; i++) { list.Add(new CustomAttributeTypedArgument(sig.GetParameterType(i), args[i])); } return(list); }
private static IList <CustomAttributeTypedArgument> ReadConstructorArguments(Assembly asm, ByteReader br, ConstructorInfo constructor) { MethodSignature sig = constructor.MethodSignature; int count = sig.GetParameterCount(); List <CustomAttributeTypedArgument> list = new List <CustomAttributeTypedArgument>(count); for (int i = 0; i < count; i++) { list.Add(ReadFixedArg(asm, br, sig.GetParameterType(i))); } return(list.AsReadOnly()); }
private static int MatchSignatures(MethodSignature sig1, MethodSignature sig2, Type[] types) { for (int i = 0; i < sig1.GetParameterCount(); i++) { Type type1 = sig1.GetParameterType(i); Type type2 = sig2.GetParameterType(i); if (type1 != type2) { return(MatchTypes(type1, type2, types[i])); } } return(0); }
private static int MatchSignatures(MethodBase mb1, MethodBase mb2, Type[] types) { MethodSignature sig1 = mb1.MethodSignature; MethodSignature sig2 = mb2.MethodSignature; IGenericBinder gb1 = mb1 as IGenericBinder ?? mb1.DeclaringType; IGenericBinder gb2 = mb2 as IGenericBinder ?? mb2.DeclaringType; for (int i = 0; i < sig1.GetParameterCount(); i++) { Type type1 = sig1.GetParameterType(gb1, i); Type type2 = sig2.GetParameterType(gb2, i); if (type1 != type2) { return(MatchTypes(type1, type2, types[i])); } } return(0); }
internal CustomAttributeData(ConstructorInfo constructor, object[] args, List <CustomAttributeNamedArgument> namedArguments) { this.lazyConstructor = constructor; MethodSignature sig = constructor.MethodSignature; List <CustomAttributeTypedArgument> list = new List <CustomAttributeTypedArgument>(); for (int i = 0; i < args.Length; i++) { list.Add(new CustomAttributeTypedArgument(sig.GetParameterType(i), args[i])); } lazyConstructorArguments = list.AsReadOnly(); if (namedArguments == null) { this.lazyNamedArguments = Empty <CustomAttributeNamedArgument> .Array; } else { this.lazyNamedArguments = namedArguments.AsReadOnly(); } }
private static List<CustomAttributeTypedArgument> WrapConstructorArgs(object[] args, MethodSignature sig) { List<CustomAttributeTypedArgument> list = new List<CustomAttributeTypedArgument>(); for (int i = 0; i < args.Length; i++) { list.Add(new CustomAttributeTypedArgument(sig.GetParameterType(i), args[i])); } return list; }
private static int MatchSignatures(MethodSignature sig1, MethodSignature sig2, Type[] types) { for (int i = 0; i < sig1.GetParameterCount(); i++) { Type type1 = sig1.GetParameterType(i); Type type2 = sig2.GetParameterType(i); if (type1 != type2) { return MatchTypes(type1, type2, types[i]); } } return 0; }