/// <summary>返回由指定元数据标记标识的方法或构造函数的运行时方法句柄,指定标记所在范围内的类型和方法的泛型类型参数。</summary> /// <returns>由 <paramref name="methodToken" /> 标识的方法或构造函数的 <see cref="T:System.RuntimeMethodHandle" />。</returns> /// <param name="methodToken">一个元数据标记,用于标识模块中的方法或构造函数。</param> /// <param name="typeInstantiationContext"> /// <see cref="T:System.RuntimeTypeHandle" /> 结构的数组,表示标记所在范围内的类型的泛型类型参数,如果类型不是泛型,则为 null。</param> /// <param name="methodInstantiationContext"> /// <see cref="T:System.RuntimeTypeHandle" /> 结构的数组,表示标记所在范围内的方法的泛型类型参数,如果方法不是泛型,则为 null。</param> /// <exception cref="T:System.BadImageFormatException"> /// <paramref name="methodToken" /> 不是当前模块中方法的有效元数据标记。- 或 -<paramref name="metadataToken" /> 不是当前模块范围内的方法或构造函数的标记。- 或 -<paramref name="metadataToken" /> 是一个 MethodSpec,它的签名中包含元素类型 var 或 mvar。</exception> /// <exception cref="T:System.InvalidOperationException">该方法在空方法句柄上调用。</exception> /// <exception cref="T:System.ArgumentOutOfRangeException"> /// <paramref name="methodToken " />不是有效的标记。</exception> public RuntimeMethodHandle ResolveMethodHandle(int methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) { return(new RuntimeMethodHandle(ModuleHandle.ResolveMethodHandleInternal(this.GetRuntimeModule(), methodToken, typeInstantiationContext, methodInstantiationContext))); }
internal static IRuntimeMethodInfo ResolveMethodHandleInternal(RuntimeModule module, int methodToken) { return(ModuleHandle.ResolveMethodHandleInternal(module, methodToken, (RuntimeTypeHandle[])null, (RuntimeTypeHandle[])null)); }