This documentation is archived and is not being maintained.

TypeBuilder.GetEvent Method (String, BindingFlags)

.NET Framework 1.1

Returns the event with the specified name.

[Visual Basic]
Overrides Overloads Public Function GetEvent( _
   ByVal name As String, _
   ByVal bindingAttr As BindingFlags _
) As EventInfo
public override EventInfo GetEvent(
 string name,
 BindingFlags bindingAttr
public: EventInfo* GetEvent(
 String* name,
 BindingFlags bindingAttr
public override function GetEvent(
   name : String,
 bindingAttr : BindingFlags
) : EventInfo;


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

Return Value

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


Exception Type Condition
NotSupportedException This method is not implemented for incomplete types.


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


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

TypeBuilder Class | TypeBuilder Members | System.Reflection.Emit Namespace | TypeBuilder.GetEvent Overload List