TypeConverter.GetProperties 方法

定义

返回由值参数指定的数组类型的属性集合。

重载

GetProperties(Object)

返回由值参数指定的数组类型的属性集合。

GetProperties(ITypeDescriptorContext, Object)

使用指定的上下文返回值参数指定的数组类型的属性的集合。

GetProperties(ITypeDescriptorContext, Object, Attribute[])

使用指定的上下文和特性返回由该值参数指定的数组类型的属性集合。

GetProperties(Object)

返回由值参数指定的数组类型的属性集合。

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties (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,它指定要为其获取属性的数组类型。

返回

具有为此数据类型公开的属性的 PropertyDescriptorCollection,或者,如果没有属性,则为 null

注解

当在此类中实现时,此方法始终返回 null

默认情况下,类型不返回属性。 此方法的简单实现可以调用 GetProperties 正确的数据类型。

适用于

GetProperties(ITypeDescriptorContext, Object)

使用指定的上下文返回值参数指定的数组类型的属性的集合。

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties (System.ComponentModel.ITypeDescriptorContext context, 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,用于提供格式上下文。

value
Object

一个 Object,它指定要为其获取属性的数组类型。

返回

具有为此数据类型公开的属性的 PropertyDescriptorCollection,或者,如果没有属性,则为 null

注解

使用 context 参数提取有关调用此转换器的环境的附加信息。 此参数可以是 null,因此请始终检查它。 同样,上下文对象的属性可以返回 null

当在此类中实现时,此方法始终返回 null

默认情况下,类型不返回属性。 此方法的简单实现可以调用 GetProperties 正确的数据类型。

另请参阅

适用于

GetProperties(ITypeDescriptorContext, Object, Attribute[])

使用指定的上下文和特性返回由该值参数指定的数组类型的属性集合。

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);
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,用于提供格式上下文。

value
Object

一个 Object,它指定要为其获取属性的数组类型。

attributes
Attribute[]

用作筛选器的 Attribute 类型数组。

返回

具有为此数据类型公开的属性的 PropertyDescriptorCollection,或者,如果没有属性,则为 null

注解

当在此类中实现时,此方法始终返回 null

继承者说明

如果要转换的类型支持属性,请重写此方法。

使用 context 参数提取有关调用此转换器的环境的附加信息。 此参数可以是 null,因此请始终检查它。 同样,上下文对象的属性可以返回 null

属性数组用于筛选数组。 这些属性可以混合 Type 使用 和 Attribute 对象。 筛选由以下规则定义:

  • Type 视为通配符;它与属性集中具有 Type 的属性匹配。

  • 如果属性没有同一 Attribute 类的 ,则返回的数组中不包含该属性。

  • 如果 特性是 的 Attribute实例,则属性必须是完全匹配的,否则它不包含在返回的数组中。

  • 如果指定了 Attribute 实例并且它是默认属性,则即使属性中没有 实例,该实例 Attribute 也会包含在返回的数组中。

另请参阅

适用于