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 的位元旗標,像是在 InvokeMethodNonPublic 等等一樣。This must be a bit flag from BindingFlags as in InvokeMethod, NonPublic, and so on.

傳回

MethodInfo[]

傳回 MethodInfo 物件的陣列,如果使用了 nonPublic,則會代表這個類型上定義的公用和非公用方法 ;否則只會傳回公用方法。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.GetTypeAssembly.GetType ,然後在抓取的型別上使用反映。Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

適用於