ScriptObject.InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]) 方法

定义

调用指定的成员。Invokes the specified member.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 virtual System::Object ^ InvokeMember(System::String ^ name, System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, System::Object ^ target, cli::array <System::Object ^> ^ args, cli::array <System::Reflection::ParameterModifier> ^ modifiers, System::Globalization::CultureInfo ^ locale, cli::array <System::String ^> ^ namedParameters);
public virtual object InvokeMember (string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object target, object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo locale, string[] namedParameters);
abstract member InvokeMember : string * System.Reflection.BindingFlags * System.Reflection.Binder * obj * obj[] * System.Reflection.ParameterModifier[] * System.Globalization.CultureInfo * string[] -> obj
override this.InvokeMember : string * System.Reflection.BindingFlags * System.Reflection.Binder * obj * obj[] * System.Reflection.ParameterModifier[] * System.Globalization.CultureInfo * string[] -> obj
Public Overridable Function InvokeMember (name As String, invokeAttr As BindingFlags, binder As Binder, target As Object, args As Object(), modifiers As ParameterModifier(), locale As CultureInfo, namedParameters As String()) As Object

参数

name
String

要调用的成员的名称。The name of the member to invoke.

invokeAttr
BindingFlags

枚举值的按位组合,用于指定反射如何执行成员搜索。A bitwise combination of the enumeration values that specifies how the search for members is conducted by reflection.

binder
Binder

一个对象,该对象执行从实参类型到形参类型的类型转换。An object that performs type conversion from actual argument type to formal argument type.

target
Object

对其调用成员的对象。The object on which to invoke the member. 此对象必须为当前脚本对象。This must be the current script object.

args
Object[]

包含要调用的成员的参数数目、顺序和类型的对象数组。An array of objects that contains the number, order, and type of the parameters of the member to be invoked. 如果没有参数,则这是一个空数组。This is an empty array if there are no parameters.

modifiers
ParameterModifier[]

长度与 args 参数相同的数组。An array that has the same length as the args parameter. 它表示元数据中被调用成员的参数特性。It represents the invoked member's argument attributes in the metadata.

locale
CultureInfo

提供有关特定区域性或区域设置的信息。Provides information about a specific culture or locale. 用于正确设置数字、日期和字符串的格式。Used to format numbers, dates, and strings correctly.

namedParameters
String[]

参数的数组。An array of parameters.

返回

Object

成员调用的返回值。The return value of the call to the member.

实现

适用于

另请参阅