ArrayConverter.GetProperties(ITypeDescriptorContext, Object, Attribute[]) Método

Definição

Obtém uma coleção de propriedades para o tipo de matriz especificado pelo parâmetro de valor.Gets a collection of properties for the type of array specified by the value parameter.

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);
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

Parâmetros

context
ITypeDescriptorContext

Um ITypeDescriptorContext que fornece um contexto de formato.An ITypeDescriptorContext that provides a format context.

value
Object

Um Object que especifica o tipo de matriz para o qual obter as propriedades.An Object that specifies the type of array to get the properties for.

attributes
Attribute[]

Uma matriz do tipo Attribute que será usada como um filtro.An array of type Attribute that will be used as a filter.

Retornos

PropertyDescriptorCollection

Um PropertyDescriptorCollection com as propriedades expostas para uma matriz ou null, se não houver propriedades.A PropertyDescriptorCollection with the properties that are exposed for an array, or null if there are no properties.

Comentários

O context parâmetro pode ser usado para extrair informações adicionais sobre o ambiente do qual esse conversor está sendo invocado.The context parameter can be used to extract additional information about the environment this converter is being invoked from. Isso pode ser null. Portanto, sempre verifique.This can be null, so always check. Além disso, as propriedades no objeto de contexto podem retornar null.Also, properties on the context object can return null.

A matriz de atributos será usada para filtrar a matriz.The attributes array will be used to filter the array. O attributes parâmetro pode especificar uma combinação de Type Attribute objetos e.The attributes parameter can specify a mix of Type and Attribute objects. A filtragem é definida pelas seguintes regras:Filtering is defined by the following rules:

  • Um Type será tratado como um curinga; ele corresponderá a qualquer propriedade que tenha o Type em seu conjunto de atributos.A Type will be treated as a wildcard; it will match any property that has the Type in its set of attributes.

  • Se uma propriedade não tiver Attribute da mesma classe, a propriedade não será incluída na matriz retornada.If a property does not have an Attribute of the same class, the property will not be included in the returned array.

  • Se o atributo for uma instância do Attribute , a propriedade deverá ser uma correspondência exata ou não será incluída na matriz retornada.If the attribute is an instance of Attribute, the property must be an exact match or it will not be included in the returned array.

  • Se uma Attribute instância for especificada e for a propriedade padrão, ela será incluída na matriz retornada, mesmo que não haja nenhuma instância do Attribute na propriedade.If an Attribute instance is specified 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.

Aplica-se a