internal virtual MethodBase FindMethod(string name, MethodSignature signature) { foreach (MethodBase method in __GetDeclaredMethods()) { if (method.Name == name && method.MethodSignature.Equals(signature)) { return method; } } return null; }
public MethodBase __CreateMissingMethod(string name, CallingConventions callingConvention, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers) { MethodSignature sig = new MethodSignature( returnType ?? this.Module.universe.System_Void, Util.Copy(parameterTypes), PackedCustomModifiers.CreateFromExternal(returnTypeOptionalCustomModifiers, returnTypeRequiredCustomModifiers, parameterTypeOptionalCustomModifiers, parameterTypeRequiredCustomModifiers, parameterTypes.Length), callingConvention, 0); MethodInfo method = new MissingMethod(this, name, sig); if (name == ".ctor" || name == ".cctor") { return new ConstructorInfoImpl(method); } return method; }
internal override MethodBase FindMethod(string name, MethodSignature signature) { MethodInfo method = new MissingMethod(this, name, signature); if (name == ".ctor") { return new ConstructorInfoImpl(method); } return method; }
internal MissingMethod(Type declaringType, string name, MethodSignature signature) { this.declaringType = declaringType; this.name = name; this.signature = signature; }
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; }
internal bool MatchParameterTypes(MethodSignature other) { return Util.ArrayEquals(other.parameterTypes, parameterTypes); }
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 MethodBase CreateMissingMethod(string name, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, PackedCustomModifiers customModifiers) { MethodSignature sig = new MethodSignature( returnType ?? this.Module.universe.System_Void, Util.Copy(parameterTypes), customModifiers, callingConvention, 0); MethodInfo method = new MissingMethod(this, name, sig); if (name == ".ctor" || name == ".cctor") { return new ConstructorInfoImpl(method); } return method; }
internal MethodBase GetMissingMethodOrThrow(Module requester, Type declaringType, string name, MethodSignature signature) { if (resolveMissingMembers) { MethodBase method = new MissingMethod(declaringType, name, signature); if (name == ".ctor") { method = new ConstructorInfoImpl((MethodInfo)method); } if (ResolvedMissingMember != null) { ResolvedMissingMember(requester, method); } return(method); } #if CORECLR throw new MissingMethodException(declaringType.ToString() + "." + name); #else throw new MissingMethodException(declaringType.ToString(), name); #endif }
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); }