ComponentConverter.GetProperties Metódus

Definíció

Beolvas egy tulajdonsággyűjteményt az értékparaméter által megadott összetevő típusához.

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

Paraméterek

context
ITypeDescriptorContext

Formátumkörnyezetet ITypeDescriptorContext biztosító környezet.

value
Object

Az Object összetevő típusának megadása a tulajdonságok lekéréséhez.

attributes
Attribute[]

Szűrőként használni kívánt típusú Attribute tömb.

Válaszok

A PropertyDescriptorCollection az összetevő számára közzétett tulajdonságokkal, vagy null ha nincsenek tulajdonságok.

Attribútumok

Megjegyzések

A context paraméter további információk kinyerésére használható azzal a környezettel kapcsolatban, amelyből a konverter meghívása történik. Ez lehet null, ezért mindig ellenőrizze. A környezeti objektum tulajdonságai is visszaadhatók null.

A attributes rendszer a tömb szűrésére használja a tömböt. A attributes vegyes Type és Attribute objektumok. A szűrést a következő szabályok határozzák meg:

  • A Type rendszer helyettesítő karakterként kezel egy objektumot, amely megfelel minden tulajdonságnak, amely az Type attribútumkészletében található.

  • Ha egy tulajdonság nem rendelkezik Attribute ugyanahhoz az osztályhoz, a tulajdonság nem lesz belefoglalva a visszaadott tömbbe.

  • Ha az attribútum egy példány Attribute, a tulajdonságnak pontos egyezésnek kell lennie, vagy nem szerepel a visszaadott tömbben.

  • Ha egy Attribute példány meg van adva, és ez az alapértelmezett tulajdonság, akkor is szerepelni fog a visszaadott tömbben, ha a tulajdonságnak nincs példánya Attribute .

A következőre érvényes: