ICustomTypeDescriptor.GetProperties 方法

定义

返回此组件实例的属性。Returns the properties for this instance of a component.

重载

GetProperties()

返回此组件实例的属性。Returns the properties for this instance of a component.

GetProperties(Attribute[])

使用特性数组作为筛选器,返回此组件实例的属性。Returns the properties for this instance of a component using the attribute array as a filter.

GetProperties()

返回此组件实例的属性。Returns the properties for this instance of a component.

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

返回

PropertyDescriptorCollection

表示此组件实例的属性的 PropertyDescriptorCollectionA PropertyDescriptorCollection that represents the properties for this component instance.

注解

此实例的属性可能不同于类提供的属性集。The properties for this instance can differ from the set of properties that the class provides. 例如,如果组件已被放置,则站点可以添加或删除其他属性。For example, if the component is sited, the site can add or remove additional properties.

PropertyDescriptorCollection.Empty如果未指定任何属性,实现者可以返回。Implementers can return PropertyDescriptorCollection.Empty if no properties are specified. 此方法决不应返回 nullThis method should never return null.

另请参阅

适用于

GetProperties(Attribute[])

使用特性数组作为筛选器,返回此组件实例的属性。Returns the properties for this instance of a component using the attribute array as a filter.

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(cli::array <Attribute ^> ^ attributes);
public System.ComponentModel.PropertyDescriptorCollection GetProperties (Attribute[] attributes);
abstract member GetProperties : Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetProperties (attributes As Attribute()) As PropertyDescriptorCollection

参数

attributes
Attribute[]

用作筛选器的 Attribute 类型数组。An array of type Attribute that is used as a filter.

返回

PropertyDescriptorCollection

一个 PropertyDescriptorCollection,它表示此组件实例的已筛选属性。A PropertyDescriptorCollection that represents the filtered properties for this component instance.

注解

此实例的属性可能不同于类提供的属性集。The properties for this instance can differ from the set of properties that the class provides. 例如,如果组件已被放置,则站点可以添加或删除其他属性。For example, if the component is sited, the site can add or remove additional properties.

如果 Attribute 在数组中指定了 attributes 并且属性不具有该属性的类的实例,则返回的集合将包含属性(如果 Attribute 是默认属性)。If an Attribute is specified in the attributes array and the property does not have an instance of the class for that attribute, the returned collection will include the property if the Attribute is the default property.

有关筛选规则,请参阅 GetPropertiesFor filtering rules, see GetProperties.

另请参阅

适用于