System.Reflection.Emit.EnumBuilder.GetEvent Method

Returns the event with the specified name.

Syntax

public override System.Reflection.EventInfo GetEvent (string name, System.Reflection.BindingFlags bindingAttr)

Parameters

name
The name of the event to get.
bindingAttr
This invocation attribute. This must be a bit flag from System.Reflection.BindingFlags : InvokeMethod, NonPublic, and so on.

Returns

Returns an System.Reflection.EventInfo object representing the event declared or inherited by this type with the specified name. If there are no matches, null is returned.

Remarks

As a workaround, to retrieve the event of a finished type, retrieve the type using Type.GetType or System.Reflection.Assembly.GetType(string) and use reflection on the retrieved type.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0