EnumBuilder.GetEvent(String, BindingFlags) 方法

定義

傳回具有指定名稱的事件。

public:
 override System::Reflection::EventInfo ^ GetEvent(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.EventInfo? GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.EventInfo GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
override this.GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
Public Overrides Function GetEvent (name As String, bindingAttr As BindingFlags) As EventInfo

參數

name
String

要取得的事件名稱。

bindingAttr
BindingFlags

這個引動過程屬性。 必須是來自 BindingFlags 的位元旗標:InvokeMethodNonPublic 等。

傳回

傳回 EventInfo 物件,代表這個類型所宣告或繼承之具有指定名稱的事件。 如果沒有符合項目,會傳回 null

例外狀況

不完整的類型目前不支援這個方法。

備註

因應措施是,若要擷取已完成類型的事件,請使用 或 Assembly.GetType 擷取型Type.GetType別,並在擷取的類型上使用反映。

適用於