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[])

使用指定的上下文和特性返回由 value 参数指定的数组类型的属性的集合。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

参数

context
ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext

一个 ITypeDescriptorContext,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.

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[])

使用指定的上下文和特性返回由 value 参数指定的数组类型的属性的集合。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

参数

context
ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext

一个 ITypeDescriptorContext,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.

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. 属性可以具有多种TypeAttribute对象。The attributes can have a mix of Type and Attribute objects. 筛选由以下规则定义:Filtering is defined by the following rules: -AType被视为通配符; 它与匹配具有的属性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.

另请参阅

适用于