TypeDescriptor.CreateEvent 方法

定義

建立一個與現有事件描述符相同的新事件描述符。

多載

名稱 Description
CreateEvent(Type, EventDescriptor, Attribute[])

當傳遞現有 EventDescriptor事件描述符時,會建立一個與現有事件描述符相同的新事件描述符。

CreateEvent(Type, String, Type, Attribute[])

建立與現有事件描述元相同的新事件描述元,方法是從類型上的指定事件動態產生描述項資訊。

CreateEvent(Type, EventDescriptor, Attribute[])

當傳遞現有 EventDescriptor事件描述符時,會建立一個與現有事件描述符相同的新事件描述符。

public:
 static System::ComponentModel::EventDescriptor ^ CreateEvent(Type ^ componentType, System::ComponentModel::EventDescriptor ^ oldEventDescriptor, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.EventDescriptor CreateEvent(Type componentType, System.ComponentModel.EventDescriptor oldEventDescriptor, params Attribute[] attributes);
static member CreateEvent : Type * System.ComponentModel.EventDescriptor * Attribute[] -> System.ComponentModel.EventDescriptor
Public Shared Function CreateEvent (componentType As Type, oldEventDescriptor As EventDescriptor, ParamArray attributes As Attribute()) As EventDescriptor

參數

componentType
Type

要建立新事件的元件類型。

oldEventDescriptor
EventDescriptor

現有的活動資訊。

attributes
Attribute[]

新屬性。

傳回

一個新檔案 EventDescriptor ,將指定的元資料屬性與現有的元資料屬性合併。

另請參閱

適用於

CreateEvent(Type, String, Type, Attribute[])

建立與現有事件描述元相同的新事件描述元,方法是從類型上的指定事件動態產生描述項資訊。

public:
 static System::ComponentModel::EventDescriptor ^ CreateEvent(Type ^ componentType, System::String ^ name, Type ^ type, ... cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.EventDescriptor CreateEvent(Type componentType, string name, Type type, params Attribute[] attributes);
static member CreateEvent : Type * string * Type * Attribute[] -> System.ComponentModel.EventDescriptor
Public Shared Function CreateEvent (componentType As Type, name As String, type As Type, ParamArray attributes As Attribute()) As EventDescriptor

參數

componentType
Type

事件所依賴的組件類型。

name
String

事件的名稱。

type
Type

負責活動的代表類型。

attributes
Attribute[]

這個事件的屬性。

傳回

一個 EventDescriptor 綁定於某個型別的

另請參閱

適用於