ComponentConverter.GetProperties Метод

Определение

Возвращает коллекцию свойств для типа компонента, указанного параметром значения.

public:
 override System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value, cli::array <Attribute ^> ^ attributes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext? context, object value, Attribute[]? attributes);
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")>]
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Overrides Function GetProperties (context As ITypeDescriptorContext, value As Object, attributes As Attribute()) As PropertyDescriptorCollection

Параметры

context
ITypeDescriptorContext

Объект, ITypeDescriptorContext предоставляющий контекст формата.

value
Object

Значение Object , указывающее тип компонента для получения свойств.

attributes
Attribute[]

Массив типа Attribute , который будет использоваться в качестве фильтра.

Возвращаемое значение

Со PropertyDescriptorCollection свойствами, предоставляемыми для компонента, или null если нет свойств.

Атрибуты

Комментарии

Этот context параметр можно использовать для извлечения дополнительных сведений о среде, из которой вызывается этот преобразователь. Это может быть nullтак всегда проверять. Кроме того, свойства объекта контекста могут возвращать null.

Массив attributes будет использоваться для фильтрации массива. Может attributes иметь сочетание Type объектов и Attribute объектов. Фильтрация определяется следующими правилами:

  • Type Объект будет рассматриваться как подстановочный знак; он будет соответствовать любому свойству, которое имеет Type его набор атрибутов.

  • Если свойство не имеет одного Attribute класса, свойство не будет включено в возвращаемый массив.

  • Если атрибут является экземпляром Attribute, свойство должно быть точным или оно не будет включено в возвращаемый массив.

  • Attribute Если указан экземпляр и он является свойством по умолчанию, он будет включен в возвращаемый массив, даже если в свойстве нет экземпляраAttribute.

Применяется к