Returns a System.Reflection.EventInfo object reflecting the public event that has the specified name and is defined in the type represented by the current instance.
- name
- A string containing the name of the public event to be returned.
A System.Reflection.EventInfo object reflecting the public event that is named name and is defined in the type represented by the current instance, if found; otherwise, null.
If the current instance represents a generic type, this method returns the System.Reflection.EventInfo with the type parameters replaced by the appropriate type arguments.
Type Reason ArgumentNullException name is null.
This version of Type.GetEvent(string) is equivalent to Type.GetEvent(string)( name, System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public ).
The search for name is case-sensitive.
If the current instance represents an unassigned type parameter of a generic type or method, this method searches the events of the class constraint; the events of all interface constraints; and the events of any interfaces inherited from class or interface constraints.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0