TypeConverter.GetProperties TypeConverter.GetProperties TypeConverter.GetProperties TypeConverter.GetProperties Method

定義

傳回由值參數所指定之陣列型別的屬性集合。Returns a collection of properties for the type of array specified by the value parameter.

多載

GetProperties(Object) GetProperties(Object) GetProperties(Object) GetProperties(Object)

傳回由值參數所指定之陣列型別的屬性集合。Returns a collection of properties for the type of array specified by the value parameter.

GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object)

會使用指定的內容,傳回由值參數所指定之陣列型別的屬性集合。Returns a collection of properties for the type of array specified by the value parameter, using the specified context.

GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[])

使用指定的內容和屬性 (Attribute),傳回由值參數所指定之陣列型別的屬性 (Property) 集合。Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.

GetProperties(Object) GetProperties(Object) GetProperties(Object) GetProperties(Object)

傳回由值參數所指定之陣列型別的屬性集合。Returns a collection of properties for the type of array specified by the value parameter.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties (object value);
member this.GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetProperties (value As Object) As PropertyDescriptorCollection

參數

value
Object Object Object Object

Object,指定要取得屬性之陣列的型別。An Object that specifies the type of array for which to get properties.

傳回

PropertyDescriptorCollection,具有為這個資料型別所公開的屬性,如果沒有屬性,則為 nullA PropertyDescriptorCollection with the properties that are exposed for this data type, or null if there are no properties.

備註

在這個類別中實作時,這個方法永遠傳回 nullAs implemented in this class, this method always returns null.

根據預設, 型別不會傳回屬性。By default, a type does not return properties. 這個方法的輕鬆執行可以針對正確GetProperties的資料類型呼叫。An easy implementation of this method can call GetProperties for the correct data type.

GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object) GetProperties(ITypeDescriptorContext, Object)

會使用指定的內容,傳回由值參數所指定之陣列型別的屬性集合。Returns a collection of properties for the type of array specified by the value parameter, using the specified context.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties (System.ComponentModel.ITypeDescriptorContext context, object value);
member this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetProperties (context As ITypeDescriptorContext, value As Object) As PropertyDescriptorCollection

參數

value
Object Object Object Object

Object,指定要取得屬性之陣列的型別。An Object that specifies the type of array for which to get properties.

傳回

PropertyDescriptorCollection,具有為這個資料型別所公開的屬性,如果沒有屬性,則為 nullA PropertyDescriptorCollection with the properties that are exposed for this data type, or null if there are no properties.

備註

context 參數可以用於擷取環境的其他資訊,而這個轉換子就是從該環境叫用的。Use the context parameter to extract additional information about the environment from which this converter is invoked. 這個參數可以是null, 所以請一律檢查它。This parameter can be null, so always check it. 甚至,內容物件上的屬性可能會傳回 nullAlso, properties on the context object can return null.

在這個類別中實作時,這個方法永遠傳回 nullAs implemented in this class, this method always returns null.

根據預設, 型別不會傳回屬性。By default, a type does not return properties. 這個方法的輕鬆執行可以針對正確GetProperties的資料類型呼叫。An easy implementation of this method can call GetProperties for the correct data type.

另請參閱

GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[]) GetProperties(ITypeDescriptorContext, Object, Attribute[])

使用指定的內容和屬性 (Attribute),傳回由值參數所指定之陣列型別的屬性 (Property) 集合。Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes.

public:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value, cli::array <Attribute ^> ^ attributes);
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties (System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes);
abstract member GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable Function GetProperties (context As ITypeDescriptorContext, value As Object, attributes As Attribute()) As PropertyDescriptorCollection

參數

value
Object Object Object Object

Object ,指定要取得屬性之陣列的型別。An Object that specifies the type of array for which to get properties.

attributes
Attribute[]

Attribute 型別的陣列,可當做篩選條件使用。An array of type Attribute that is used as a filter.

傳回

PropertyDescriptorCollection,具有為這個資料型別所公開的屬性,如果沒有屬性,則為 nullA PropertyDescriptorCollection with the properties that are exposed for this data type, or null if there are no properties.

備註

在這個類別中實作時,這個方法永遠傳回 nullAs implemented in this class, this method always returns null.

給繼承者的注意事項

如果您想要轉換的類型支援屬性, 請覆寫這個方法。Override this method if the type you want to convert supports properties.

context 參數可以用於擷取環境的其他資訊,而這個轉換子就是從該環境叫用的。Use the context parameter to extract additional information about the environment from which this converter is invoked. 這個參數可以是null, 所以請一律檢查它。This parameter can be null, so always check it. 甚至,內容物件上的屬性可能會傳回 nullAlso, properties on the context object can return null.

屬性陣列是用來篩選陣列。The attributes array is used to filter the array. 屬性可以混合Type使用和Attribute物件。The attributes can have a mix of Type and Attribute objects. 篩選是由下列規則所定義:Filtering is defined by the following rules: -A Type會被視為萬用字元, 它會比對具有屬性集內Type的屬性。- A Type is treated as a wildcard; it matches a property that has the Type in its set of attributes.

-如果屬性不具有Attribute相同類別的, 則該屬性不會包含在傳回的陣列中。- If a property does not have an Attribute of the same class, the property is not included in the returned array.

-如果屬性是的實例Attribute, 則屬性必須完全相符, 否則不會包含在傳回的陣列中。- If the attribute is an instance of Attribute, the property must be an exact match or it is not included in the returned array.

-如果Attribute已指定實例, 而且它是預設屬性, 則即使屬性Attribute中沒有的實例, 它仍會包含在傳回的陣列中。- If an Attribute instance is specified and it is the default property, it is included in the returned array even if there is no instance of the Attribute in the property.

另請參閱

適用於