TypeBuilder::DefineEvent Method (String^, EventAttributes, Type^)
.NET Framework (current version)
Adds a new event to the type, with the given name, attributes and event type.
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.
| 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
Available since 1.1
Silverlight
Available since 2.0
Show: