語言

TypeBuilder.DefineEvent(String, EventAttributes, Type) 方法

定義

新增一個事件,包含名稱、屬性和事件類型。

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

參數

name
String

事件的名稱。 name 無法包含嵌入的空。

attributes
EventAttributes

活動的特質。

eventtype
Type

事件的類型。

傳回

定義事件。

例外狀況

的 name 長度為零。

name 是 null。

-或-

eventtype 是 null。

該類型先前是使用 CreateType()。

適用於