語言

EnumBuilder.GetEvents 方法

定義

此方法不支援尚未完成的類型。

多載

名稱 Description
GetEvents()

回傳由此類型宣告或繼承的公開事件的事件。

GetEvents(BindingFlags)

回傳由此類型宣告的公開與非公開事件。

GetEvents()

來源:
EnumBuilder.cs

回傳由此類型宣告或繼承的公開事件的事件。

public:
 override cli::array <System::Reflection::EventInfo ^> ^ GetEvents();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents();
public override System.Reflection.EventInfo[] GetEvents();
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)>]
override this.GetEvents : unit -> System.Reflection.EventInfo[]
override this.GetEvents : unit -> System.Reflection.EventInfo[]
Public Overrides Function GetEvents () As EventInfo()

傳回

回傳一組 EventInfo 代表此類型宣告或繼承的公開事件的物件陣列。 若無公開事件,則回傳空陣列。

屬性

例外狀況

目前此方法未支援未完成型別。

備註

作為一個變通方法,要取得完成型態的事件,請使用 Type.GetType 或 Assembly.GetType 來檢索該型別,並對檢索出的型別使用反射。

適用於

GetEvents(BindingFlags)

來源:
EnumBuilder.cs

回傳由此類型宣告的公開與非公開事件。

public:
 override cli::array <System::Reflection::EventInfo ^> ^ GetEvents(System::Reflection::BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)>]
override this.GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
override this.GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
Public Overrides Function GetEvents (bindingAttr As BindingFlags) As EventInfo()

參數

bindingAttr
BindingFlags

這必須是來自 BindingFlags的 一個 旗幟,例如 InvokeMethod、 NonPublic,依此類推。

傳回

回傳代表此類型宣告或繼承的公開與非公開事件的物件陣列 EventInfo 。 若無事件,則回傳空陣列。

屬性

例外狀況

目前此方法未支援未完成型別。

備註

作為一個變通方法,要取得完成型態的事件,請使用 Type.GetType 或 Assembly.GetType 並對被檢索型別的反射來取得該事件。

適用於