Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
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)

[SecuritySafeCriticalAttribute]
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.

ExceptionCondition
ArgumentException

The length of name is zero.

ArgumentNullException

name is null.

-or-

eventtype is null.

InvalidOperationException

The type was previously created using CreateType.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2015 Microsoft