internal static void GetInputAssemblies(this MethodRef methodRef, ISet <AssemblyName> assemblies) { Requires.NotNull(assemblies, nameof(assemblies)); if (!methodRef.IsEmpty) { assemblies.Add(methodRef.DeclaringType.AssemblyName); foreach (var typeArg in methodRef.GenericMethodArguments) { GetInputAssemblies(typeArg, assemblies); } } }
public static MethodInfo Resolve(this MethodRef methodRef) { if (methodRef.IsEmpty) { return(null); } var manifest = methodRef.Resolver.GetManifest(methodRef.DeclaringType.AssemblyName); var method = (MethodInfo)manifest.ResolveMethod(methodRef.MetadataToken); if (methodRef.GenericMethodArguments.Length > 0) { var constructedMethod = method.MakeGenericMethod(methodRef.GenericMethodArguments.Select(Resolve).ToArray()); return(constructedMethod); } return(method); }
public MemberRef(MethodRef method) : this() { this.Method = method; }
public ParameterRef(MethodRef method, int parameterIndex) : this() { this.Method = method; this.parameterIndex = parameterIndex; }
public static MethodInfo Resolve(this MethodRef methodRef) => (MethodInfo)Resolve2(methodRef);
public ParameterRef(MethodRef method, int parameterIndex) : this(method.DeclaringType, method.MetadataToken, parameterIndex) { }