Returns an array of System.Reflection.EventInfo objects that reflect the events that are defined in the type represented by the current instance and match the specified binding constraints.
- bindingAttr
- A bitwise combination of System.Reflection.BindingFlags values that control the binding process. If zero is specified, this method returns null.
An array of System.Reflection.EventInfo objects that reflect the events that are defined in the type represented by the current instance and match the constraints of bindingAttr . If no events match these constraints, returns an empty array. If the type reflected by the current instance is from a loaded assembly and the caller does not have permission to reflect on non-public objects in loaded assemblies, returns only public events.
If the current instance represents a generic type, this method returns the System.Reflection.EventInfo objects with the type parameters replaced by the appropriate type arguments.
Type Reason System.Security.Permissions.ReflectionPermission Requires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.
The following System.Reflection.BindingFlags are used to define which events to include in the search:
- Specify either System.Reflection.BindingFlags.Instance or System.Reflection.BindingFlags.Static to get a return value other than null.
- Specify System.Reflection.BindingFlags.Public to include public events in the search.
- Specify System.Reflection.BindingFlags.NonPublic to include non-public events (that is, private and protected events) in the search.
Note: For more information, see System.Reflection.BindingFlags.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.
Operation
As described above.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0