Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public MemberRef(MethodRef method)
     : this()
 {
     this.Method = method;
 }
Exemplo n.º 4
0
 public ParameterRef(MethodRef method, int parameterIndex)
     : this()
 {
     this.Method         = method;
     this.parameterIndex = parameterIndex;
 }
Exemplo n.º 5
0
 public static MethodInfo Resolve(this MethodRef methodRef) => (MethodInfo)Resolve2(methodRef);
Exemplo n.º 6
0
 public ParameterRef(MethodRef method, int parameterIndex)
     : this(method.DeclaringType, method.MetadataToken, parameterIndex)
 {
 }