ExpandableObjectConverter.GetProperties Metodo

Definizione

Ottiene un insieme di proprietà per il tipo di oggetto specificato dal parametro del valore.

public:
 override System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value, cli::array <Attribute ^> ^ attributes);
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);
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

Parametri

context
ITypeDescriptorContext

Oggetto ITypeDescriptorContext che fornisce un contesto di formato.

value
Object

Oggetto Object che specifica il tipo di oggetto di cui ottenere le proprietà.

attributes
Attribute[]

Matrice di tipo Attribute che verrà utilizzata come filtro.

Restituisce

PropertyDescriptorCollection con le proprietà esposte per il componente oppure null se non sono specificate proprietà.

Commenti

Il parametro context può essere utilizzato per ottenere ulteriori informazioni sull'ambiente dal quale viene richiamato il convertitore. Dal momento che può essere null, è preferibile eseguire sempre un controllo. Anche le proprietà dell'oggetto di contesto possono restituire null.

La attributes matrice verrà usata per filtrare la matrice. Può attributes avere una combinazione di Type oggetti e Attribute . Il filtro viene definito dalle regole seguenti:

  • Un Type oggetto verrà considerato come un carattere jolly e corrisponderà a qualsiasi proprietà con nel Type relativo set di attributi.

  • Se una proprietà non ha una Attribute classe della stessa classe, la proprietà non verrà inclusa nella matrice restituita.

  • Se l'attributo è un'istanza di Attribute, la proprietà deve essere una corrispondenza esatta o non verrà inclusa nella matrice restituita.

  • Se viene specificata un'istanza Attribute di ed è la proprietà predefinita, verrà inclusa nella matrice restituita anche se non è presente alcuna istanza di Attribute nella proprietà .

Si applica a

Vedi anche