Export (0) Print
Expand All

TypeBuilder.DefineEvent Method

Adds a new event to the type, with the given name, attributes and event type.

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)

public EventBuilder DefineEvent (
	string name,
	EventAttributes attributes,
	Type eventtype
)
public EventBuilder DefineEvent (
	String name, 
	EventAttributes attributes, 
	Type eventtype
)
public function DefineEvent (
	name : String, 
	attributes : EventAttributes, 
	eventtype : Type
) : EventBuilder
Not applicable.

Parameters

name

The name of the event. name cannot contain embedded nulls.

attributes

The attributes of the event.

eventtype

The type of the event.

Return Value

The defined event.

Exception typeCondition

ArgumentException

The length of name is zero.

ArgumentNullException

name is a null reference (Nothing in Visual Basic).

-or-

eventtype is a null reference (Nothing in Visual Basic).

InvalidOperationException

The type was previously created using CreateType.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft