TypeDescriptor.CreateProperty 方法

定義

為元件現有屬性建立新的屬性描述項。

多載

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

使用指定的屬性名稱、類型和屬性陣列,建立並以動態方式將屬性描述項繫結至類型。

CreateProperty(Type, PropertyDescriptor, Attribute[])

使用指定的現有 PropertyDescriptor 和屬性 (Attribute) 陣列,從現有的屬性 (Property) 描述項建立新的屬性 (Property) 描述項。

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

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

使用指定的屬性名稱、類型和屬性陣列,建立並以動態方式將屬性描述項繫結至類型。

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

參數

componentType
Type

屬性所屬之元件的 Type

name
String

屬性的名稱。

type
Type

屬性的 Type

attributes
Attribute[]

這個屬性 (Property) 的新屬性 (Attribute)。

傳回

PropertyDescriptor,繫結至指定的類型,且具有與現有的中繼資料屬性合併的指定的中繼資料屬性。

另請參閱

適用於

CreateProperty(Type, PropertyDescriptor, Attribute[])

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

使用指定的現有 PropertyDescriptor 和屬性 (Attribute) 陣列,從現有的屬性 (Property) 描述項建立新的屬性 (Property) 描述項。

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

參數

componentType
Type

屬性所屬之元件的 Type

oldPropertyDescriptor
PropertyDescriptor

現有的屬性描述項。

attributes
Attribute[]

這個屬性 (Property) 的新屬性 (Attribute)。

傳回

新的 PropertyDescriptor,其中的指定中繼資料屬性已與現有的中繼資料屬性合併。

另請參閱

適用於