TypeDescriptor.CreateProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為元件的既有屬性建立新的屬性描述符。
多載
| 名稱 | Description |
|---|---|
| CreateProperty(Type, String, Type, Attribute[]) |
使用指定的屬性名稱、類型和屬性數位,建立並動態地將屬性描述元系結至類型。 |
| CreateProperty(Type, PropertyDescriptor, Attribute[]) |
利用指定的既有 PropertyDescriptor 與屬性陣列,從現有屬性描述符建立新的屬性描述符。 |
CreateProperty(Type, String, Type, Attribute[])
使用指定的屬性名稱、類型和屬性數位,建立並動態地將屬性描述元系結至類型。
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
參數
- name
- String
屬性的名稱。
- attributes
- Attribute[]
這個屬性的新屬性。
傳回
PropertyDescriptor A 綁定於指定型別,且將指定的元資料屬性與現有的元資料屬性合併。
另請參閱
適用於
CreateProperty(Type, PropertyDescriptor, Attribute[])
利用指定的既有 PropertyDescriptor 與屬性陣列,從現有屬性描述符建立新的屬性描述符。
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
參數
- oldPropertyDescriptor
- PropertyDescriptor
現有的房產描述符。
- attributes
- Attribute[]
這個屬性的新屬性。
傳回
一個 PropertyDescriptor 將指定的元資料屬性與現有元資料屬性合併的新檔案。