Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TypeBuilder::DefineEvent Method (String^, EventAttributes, Type^)

 

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
)

Parameters

name
Type: System::String^

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

attributes
Type: System.Reflection::EventAttributes

The attributes of the event.

eventtype
Type: System::Type^

The type of the event.

Return Value

Type: System.Reflection.Emit::EventBuilder^

The defined event.

Exception Condition
ArgumentException

The length of name is zero.

ArgumentNullException

name is null.

-or-

eventtype is null.

InvalidOperationException

The type was previously created using CreateType.

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Return to top
Show:
© 2017 Microsoft