TypeBuilder.DefineEvent(String, EventAttributes, Type) Metod

Definition

Lägger till en ny händelse i typen med förnamn, attribut och händelsetyp.

public:
 System::Reflection::Emit::EventBuilder ^ DefineEvent(System::String ^ name, System::Reflection::EventAttributes attributes, Type ^ eventtype);
public System.Reflection.Emit.EventBuilder DefineEvent(string name, System.Reflection.EventAttributes attributes, Type eventtype);
member this.DefineEvent : string * System.Reflection.EventAttributes * Type -> System.Reflection.Emit.EventBuilder
Public Function DefineEvent (name As String, attributes As EventAttributes, eventtype As Type) As EventBuilder

Parametrar

name
String

Namnet på händelsen. name kan inte innehålla inbäddade null-värden.

attributes
EventAttributes

Händelsens attribut.

eventtype
Type

Typen av händelse.

Returer

Den definierade händelsen.

Undantag

Längden name på är noll.

name är null.

-eller-

eventtype är null.

Typen skapades tidigare med .CreateType()

Gäller för