TypeBuilder.GetMethods(BindingFlags) 方法
定义
按照指定,返回此类型声明或继承的所有公共和非公共方法。Returns all the public and non-public methods declared or inherited by this type, as specified.
public:
override cli::array <System::Reflection::MethodInfo ^> ^ GetMethods(System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.MethodInfo[] GetMethods (System.Reflection.BindingFlags bindingAttr);
override this.GetMethods : System.Reflection.BindingFlags -> System.Reflection.MethodInfo[]
Public Overrides Function GetMethods (bindingAttr As BindingFlags) As MethodInfo()
参数
- bindingAttr
- BindingFlags
这必须是 BindingFlags 中的位标志,类似于 InvokeMethod、NonPublic 等中的位标志。This must be a bit flag from BindingFlags as in InvokeMethod, NonPublic, and so on.
返回
如果使用 nonPublic,则返回 MethodInfo 对象数组,表示在该类型上定义的公共和非公共方法;否则,仅返回公共方法。Returns an array of MethodInfo objects representing the public and non-public methods defined on this type if nonPublic is used; otherwise, only the public methods are returned.
例外
不会为不完整类型实现此方法。This method is not implemented for incomplete types.
注解
使用或检索类型 Type.GetType Assembly.GetType ,并对检索到的类型使用反射。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.