_Type.GetMethods 方法

定义

为 COM 对象提供对 GetMethods 方法的与版本无关的访问。

重载

GetMethods()

为 COM 对象提供对 GetMethods() 方法的与版本无关的访问。

GetMethods(BindingFlags)

为 COM 对象提供对 GetMethods(BindingFlags) 方法的与版本无关的访问。

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetMethods 获取当前 Type的方法。

GetMethods()

为 COM 对象提供对 GetMethods() 方法的与版本无关的访问。

public:
 cli::array <System::Reflection::MethodInfo ^> ^ GetMethods();
public System.Reflection.MethodInfo[] GetMethods ();
abstract member GetMethods : unit -> System.Reflection.MethodInfo[]
Public Function GetMethods () As MethodInfo()

返回

表示为当前 MethodInfo 定义的所有公共方法的 Type 对象数组。

- 或 -

如果没有为当前 MethodInfo 定义的公共方法,则为 Type 类型的空数组。

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetMethods 返回当前 Type的所有公共方法。

适用于

GetMethods(BindingFlags)

为 COM 对象提供对 GetMethods(BindingFlags) 方法的与版本无关的访问。

public:
 cli::array <System::Reflection::MethodInfo ^> ^ GetMethods(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.MethodInfo[] GetMethods (System.Reflection.BindingFlags bindingAttr);
abstract member GetMethods : System.Reflection.BindingFlags -> System.Reflection.MethodInfo[]
Public Function GetMethods (bindingAttr As BindingFlags) As MethodInfo()

参数

bindingAttr
BindingFlags

一个位屏蔽,由一个或多个指定搜索执行方式的 BindingFlags 组成。

- 或 -

零,以返回 null

返回

表示为当前 MethodInfo 定义的匹配指定绑定约束的所有方法的 Type 对象数组。

- 或 -

如果没有为当前 MethodInfo 定义的方法,或者如果没有一个定义的方法匹配绑定约束,则为 Type 类型的空数组。

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。

方法 Type.GetMethods 使用指定的绑定约束搜索为当前 Type定义的方法。

适用于