TypeBuilder.GetMethodImpl 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当在派生类中重写时,使用指定的绑定约束和指定的调用约定搜索其参数与指定的自变量类型和修饰符匹配的指定方法。
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);
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);
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);
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
包含要获取的方法名称的字符串。
- binder
- Binder
一个对象,该对象定义一组属性并启用绑定,而绑定可能涉及选择重载方法、强制参数类型和通过反射调用成员。
或
要使用 Nothing
的空引用(在 Visual Basic 中为 DefaultBinder)。
- callConvention
- CallingConventions
该对象,用于指定要使用的一套规则,这些规则涉及自变量的顺序和布局、传递返回值的方式、用于自变量的寄存器以及哪个进程清理堆栈。
- types
- Type[]
表示此方法要获取的参数的个数、顺序和类型的 Type 对象数组。
或
一个类型为 Type (即 Type[] types = new Type[0])的空数组,用于获取一个不带参数的方法。
或
null
. 如果 types
为 null
,则自变量不匹配。
- modifiers
- ParameterModifier[]
ParameterModifier 对象的数组,表示与 types
数组中的相应元素关联的特性。 默认的联编程序不处理此参数。
返回
表示符合指定要求的方法的对象(如果找到的话);否则为 null
。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈