Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.