Edit

Share via


_Type.GetEvents Method

Definition

Provides COM objects with version-independent access to the GetEvents method.

Overloads

GetEvents()

Provides COM objects with version-independent access to the GetEvents() method.

GetEvents(BindingFlags)

Provides COM objects with version-independent access to the GetEvents(BindingFlags) method.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetEvents method gets the events that are declared or inherited by the current Type.

GetEvents()

Provides COM objects with version-independent access to the GetEvents() method.

public:
 cli::array <System::Reflection::EventInfo ^> ^ GetEvents();
public System.Reflection.EventInfo[] GetEvents ();
abstract member GetEvents : unit -> System.Reflection.EventInfo[]
Public Function GetEvents () As EventInfo()

Returns

An array of EventInfo objects representing all the public events that are declared or inherited by the current Type.

-or-

An empty array of type EventInfo, if the current Type does not have public events.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetEvents method returns all the public events that are declared or inherited by the current Type.

Applies to

GetEvents(BindingFlags)

Provides COM objects with version-independent access to the GetEvents(BindingFlags) method.

public:
 cli::array <System::Reflection::EventInfo ^> ^ GetEvents(System::Reflection::BindingFlags bindingAttr);
public System.Reflection.EventInfo[] GetEvents (System.Reflection.BindingFlags bindingAttr);
abstract member GetEvents : System.Reflection.BindingFlags -> System.Reflection.EventInfo[]
Public Function GetEvents (bindingAttr As BindingFlags) As EventInfo()

Parameters

bindingAttr
BindingFlags

A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

Zero, to return null.

Returns

An array of EventInfo objects representing all events that are declared or inherited by the current Type that match the specified binding constraints.

-or-

An empty array of type EventInfo, if the current Type does not have events, or if none of the events match the binding constraints.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The Type.GetEvents method searches for events that are declared or inherited by the current Type, using the specified binding constraints.

Applies to