TypeBuilder.GetMethodImpl 方法

定义

在派生类中重写时,使用指定的绑定约束和指定的调用约定搜索其参数与指定参数类型和修饰符匹配的指定方法。

protected:
 override System::Reflection::MethodInfo ^ GetMethodImpl(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, System::Reflection::CallingConventions callConvention, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected override System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)>]
override this.GetMethodImpl : string * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Protected Overrides Function GetMethodImpl (name As String, bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As MethodInfo

参数

name
String

包含要获取的方法的名称的字符串。

bindingAttr
BindingFlags

枚举值的按位组合,用于指定如何执行搜索。

-或-

Default null返回 。

binder
Binder

一个对象,定义一组属性并启用绑定,这可能涉及选择重载的方法、强制参数类型以及通过反射调用成员。

-或-

null 引用(Nothing in Visual Basic),以使用 DefaultBinder

callConvention
CallingConventions

该对象指定要用于参数的顺序和布局的规则集、传递返回值的方式、用于参数的寄存器以及清理堆栈的过程。

types
Type[]

一个 Type 对象数组,表示要获取的方法的参数的数量、顺序和类型。

-或-

类型(即 Type[] types = new Type[0])的 Type 空数组,用于获取不带参数的方法。

-或-

nulltypes如果是null,则参数不匹配。

modifiers
ParameterModifier[]

表示与数组中ParameterModifier相应元素关联的属性的对象数组types。 默认绑定器不处理此参数。

返回

一个对象,表示符合指定要求的方法(如果找到);否则,为 null.

属性

适用于