Edit

Share via


TypeBuilder.GetEvent(String, BindingFlags) Method

Definition

Returns the event with the specified name.

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

Parameters

name
String

The name of the event to search for.

bindingAttr
BindingFlags

A bitwise combination of BindingFlags values that limits the search.

Returns

An EventInfo object representing the event declared or inherited by this type with the specified name, or null if there are no matches.

Exceptions

This method is not implemented for incomplete types.

Remarks

Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.

Applies to