TypeDescriptor.CreateEvent 方法

定義

建立新的事件描述元,其等同於現有的事件描述元。

多載

CreateEvent(Type, EventDescriptor, Attribute[])

當傳遞到現有的 EventDescriptor 時,建立與現有事件描述元相同的新事件描述元。

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

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

CreateEvent(Type, EventDescriptor, Attribute[])

來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs

當傳遞到現有的 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[])

來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs
來源:
TypeDescriptor.cs

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

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

另請參閱

適用於