IReflect.GetMethods(BindingFlags) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索具有当前类的所有公共方法或所有方法的对象数组 MethodInfo 。
public:
cli::array <System::Reflection::MethodInfo ^> ^ GetMethods(System::Reflection::BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
public System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)>]
abstract member GetMethods : System.Reflection.BindingFlags -> System.Reflection.MethodInfo[]
abstract member GetMethods : System.Reflection.BindingFlags -> System.Reflection.MethodInfo[]
Public Function GetMethods (bindingAttr As BindingFlags) As MethodInfo()
参数
- bindingAttr
- BindingFlags
用于控制搜索的绑定属性。
返回
一个 MethodInfo 对象数组,其中包含为此反射对象定义的所有方法,这些方法符合指定的 bindingAttr搜索约束。
- 属性
注解
仅当返回公共方法时,才会指示非公共属性 bindingAttr 。