PropertyDescriptor.GetChildProperties 方法

定义

重载

GetChildProperties()

返回默认的 PropertyDescriptorCollectionReturns the default PropertyDescriptorCollection.

GetChildProperties(Attribute[])

通过将指定的特性数组用作筛选器,返回 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection using a specified array of attributes as a filter.

GetChildProperties(Object)

返回给定对象的 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection for a given object.

GetChildProperties(Object, Attribute[])

通过将指定的特性数组用作筛选器,返回给定对象的 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection for a given object using a specified array of attributes as a filter.

GetChildProperties()

返回默认的 PropertyDescriptorCollectionReturns the default PropertyDescriptorCollection.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetChildProperties();
public System.ComponentModel.PropertyDescriptorCollection GetChildProperties ();
member this.GetChildProperties : unit -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetChildProperties () As PropertyDescriptorCollection

返回

PropertyDescriptorCollection

属性描述符的集合。A collection of property descriptor.

注解

此方法为 instance 参数和 filter 参数传递 nullThis method passes null for both the instance parameter and the filter parameter.

instance 参数的属性可能不同于类的属性,因为如果 instance 参数已占位,则容器可以添加或移除属性。The properties for the instance parameter can differ from the properties of a class, because the container can add or remove properties if the instance parameter is sited.

filter 参数可以混合使用 TypeAttribute 对象。The filter parameter can mix Type and Attribute objects. 筛选由以下规则定义:Filtering is defined by the following rules:

  • Type 对象将被视为通配符;它匹配其属性集中具有 Type 的任何属性。A Type object is treated as a wildcard; it matches any 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 will not be included in the returned array.

  • 如果该特性是 Attribute的实例,则该属性必须是要在返回的数组中包含的精确匹配项。If the attribute is an instance of Attribute, the property must be an exact match to be included in the returned array.

  • 如果指定 Attribute 并且它是默认属性,则该属性将包含在返回的数组中,即使属性中没有 Attribute 的实例也是如此。If you specify an Attribute and it is the default property, it will be included in the returned array, even if there is no instance of Attribute in the property.

另请参阅

GetChildProperties(Attribute[])

通过将指定的特性数组用作筛选器,返回 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection using a specified array of attributes as a filter.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetChildProperties(cli::array <Attribute ^> ^ filter);
public System.ComponentModel.PropertyDescriptorCollection GetChildProperties (Attribute[] filter);
member this.GetChildProperties : Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetChildProperties (filter As Attribute()) As PropertyDescriptorCollection

参数

filter
Attribute[]

要用作筛选器的类型 Attribute 数组。An array of type Attribute to use as a filter.

返回

PropertyDescriptorCollection

一个 PropertyDescriptorCollection,具有与指定的特性匹配的属性。A PropertyDescriptorCollection with the properties that match the specified attributes.

注解

此方法传递 instance 参数 nullThis method passes null for the instance parameter.

instance 参数的属性可能不同于类的属性,因为如果 instance 参数已占位,则站点可以添加或删除属性。The properties for the instance parameter can differ from the properties of a class, because the site can add or remove properties if the instance parameter is sited.

filter 参数可以混合使用 TypeAttribute 对象。The filter parameter can mix Type and Attribute objects. 筛选由以下规则定义:Filtering is defined by the following rules:

  • Type 对象将被视为通配符;它匹配其属性集中具有 Type 的任何属性。A Type object is treated as a wildcard; it matches any 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 will not be included in the returned array.

  • 如果该特性是 Attribute的实例,则该属性必须是要在返回的数组中包含的精确匹配项。If the attribute is an instance of Attribute, the property must be an exact match to be included in the returned array.

  • 如果指定 Attribute 实例并且它是默认属性,则即使属性中没有 Attribute 的实例,它也将包含在返回的数组中。If you specify an Attribute instance and it is the default property, it will be included in the returned array even if there is no instance of the Attribute in the property.

另请参阅

GetChildProperties(Object)

返回给定对象的 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection for a given object.

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

参数

instance
Object

要为其获取属性的组件。A component to get the properties for.

返回

PropertyDescriptorCollection

具有指定组件的属性的 PropertyDescriptorCollectionA PropertyDescriptorCollection with the properties for the specified component.

注解

此方法传递 filter 参数 nullThis method passes null for the filter parameter.

instance 参数的属性可能不同于类的属性,因为如果 instance 参数已占位,则站点可以添加或删除属性。The properties for the instance parameter can differ from the properties of a class, because the site can add or remove properties if the instance parameter is sited.

filter 参数可以混合使用 TypeAttribute 对象。The filter parameter can mix Type and Attribute objects. 筛选由以下规则定义:Filtering is defined by the following rules:

  • Type 对象将被视为通配符;它匹配其属性集中具有 Type 的任何属性。A Type object is treated as a wildcard; it matches any 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 will not be included in the returned array.

  • 如果该特性是 Attribute的实例,则该属性必须是要在返回的数组中包含的精确匹配项。If the attribute is an instance of Attribute, the property must be an exact match to be included in the returned array.

  • 如果指定 Attribute 实例并且它是默认属性,则即使属性中没有 Attribute 的实例,它也将包含在返回的数组中。If you specify an Attribute instance and it is the default property, it will be included in the returned array even if there is no instance of the Attribute in the property.

另请参阅

GetChildProperties(Object, Attribute[])

通过将指定的特性数组用作筛选器,返回给定对象的 PropertyDescriptorCollectionReturns a PropertyDescriptorCollection for a given object using a specified array of attributes as a filter.

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

参数

instance
Object

要为其获取属性的组件。A component to get the properties for.

filter
Attribute[]

要用作筛选器的类型 Attribute 数组。An array of type Attribute to use as a filter.

返回

PropertyDescriptorCollection

具有与指定组件的指定属性相匹配的属性的 PropertyDescriptorCollectionA PropertyDescriptorCollection with the properties that match the specified attributes for the specified component.

注解

instance 参数的属性可能不同于类的属性,因为如果 instance 参数已占位,则站点可以添加或删除属性。The properties for the instance parameter can differ from the properties of a class, because the site can add or remove properties if the instance parameter is sited.

filter 参数可以混合使用 TypeAttribute 对象。The filter parameter can mix Type and Attribute objects. 筛选由以下规则定义:Filtering is defined by the following rules:

  • Type 对象将被视为通配符;它匹配其属性集中具有 Type 的任何属性。A Type object is treated as a wildcard; it matches any 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 will not be included in the returned array.

  • 如果该特性是 Attribute的实例,则该属性必须是要在返回的数组中包含的精确匹配项。If the attribute is an instance of Attribute, the property must be an exact match to be included in the returned array.

  • 如果指定 Attribute 实例并且它是默认属性,则即使属性中没有 Attribute 的实例,它也将包含在返回的数组中。If you specify an Attribute instance and it is the default property, it will be included in the returned array even if there is no instance of the Attribute in the property.

通常,应通过实现从此属性返回的 TypeConverterGetProperties 成员来返回子属性。Generally, child properties should be returned by implementing the GetProperties member of the TypeConverter returned from this property.

另请参阅

适用于