Type.GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) Método
Definição
Quando substituído em uma classe derivada, pesquisa a propriedade especificada cujos parâmetros correspondem aos modificadores e tipos de argumento especificados, usando as restrições de associação especificadas.When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints.
protected:
abstract System::Reflection::PropertyInfo ^ GetPropertyImpl(System::String ^ name, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, Type ^ returnType, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
protected abstract System.Reflection.PropertyInfo? GetPropertyImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, Type? returnType, Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
protected abstract System.Reflection.PropertyInfo GetPropertyImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetPropertyImpl : string * System.Reflection.BindingFlags * System.Reflection.Binder * Type * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.PropertyInfo
Protected MustOverride Function GetPropertyImpl (name As String, bindingAttr As BindingFlags, binder As Binder, returnType As Type, types As Type(), modifiers As ParameterModifier()) As PropertyInfo
Parâmetros
- name
- String
A cadeia de caracteres que contém o nome da propriedade a ser obtida.The string containing the name of the property to get.
- bindingAttr
- BindingFlags
Uma combinação bit a bit dos valores de enumeração que especificam como a pesquisa é realizada.A bitwise combination of the enumeration values that specify how the search is conducted.
- ou --or-
Default para retornar null.Default to return null.
- binder
- Binder
Um objeto que define um conjunto de propriedades e habilita a associação, que pode envolver seleção de um membro sobrecarregado, coerção de tipos de argumento e invocação de um membro por meio da reflexão.An object that defines a set of properties and enables binding, which can involve selection of an overloaded member, coercion of argument types, and invocation of a member through reflection.
- ou --or-
Uma referência nula (Nothing no Visual Basic), para usar o DefaultBinder.A null reference (Nothing in Visual Basic), to use the DefaultBinder.
- returnType
- Type
O tipo de retorno da propriedade.The return type of the property.
- types
- Type[]
Uma matriz de objetos Type que representam o número, a ordem e o tipo de parâmetros para a propriedade indexada a ser obtida.An array of Type objects representing the number, order, and type of the parameters for the indexed property to get.
- ou --or- Uma matriz vazia do tipo Type (ou seja, tipos Type[] = novo Type[0]) para obter uma propriedade que não seja indexada.An empty array of the type Type (that is, Type[] types = new Type[0]) to get a property that is not indexed.
- modifiers
- ParameterModifier[]
Uma matriz de objetos ParameterModifier que representam os atributos associados ao elemento correspondente na matriz types.An array of ParameterModifier objects representing the attributes associated with the corresponding element in the types array. O associador padrão não processa este parâmetro.The default binder does not process this parameter.
Retornos
Um objeto que representa a propriedade que corresponde aos requisitos especificados, se for encontrado; caso contrário, null.An object representing the property that matches the specified requirements, if found; otherwise, null.
Exceções
É encontrada mais de uma propriedade com o nome especificado e que corresponde às restrições de associação especificadas.More than one property is found with the specified name and matching the specified binding constraints.
name é null.name is null.
- ou --or-
types é null.types is null.
- ou --or-
Um dos elementos em types é null.One of the elements in types is null.
types é multidimensional.types is multidimensional.
- ou --or-
modifiers é multidimensional.modifiers is multidimensional.
- ou --or-
types e modifiers não têm o mesmo tamanho.types and modifiers do not have the same length.
O tipo atual é um TypeBuilder, EnumBuilder ou GenericTypeParameterBuilder.The current type is a TypeBuilder, EnumBuilder, or GenericTypeParameterBuilder.
Comentários
Embora o associador padrão não processe ParameterModifier (o parâmetro modifiers ), é possível usar a classe abstrata System.Reflection.Binder para gravar um associador personalizado que processa modifiers.Although the default binder does not process ParameterModifier (the modifiers parameter), you can use the abstract System.Reflection.Binder class to write a custom binder that does process modifiers. ParameterModifier é usado apenas ao chamar por meio de interoperabilidade COM e apenas parâmetros que são passados por referência são manipulados.ParameterModifier is only used when calling through COM interop, and only parameters that are passed by reference are handled.
Os sinalizadores de filtro a seguir BindingFlags podem ser usados para definir quais propriedades serão incluídas na pesquisa:The following BindingFlags filter flags can be used to define which properties to include in the search:
Você deve especificar
BindingFlags.InstanceouBindingFlags.Staticpara obter um retorno.You must specify eitherBindingFlags.InstanceorBindingFlags.Staticin order to get a return.Especifique
BindingFlags.Publicpara incluir propriedades públicas na pesquisa.SpecifyBindingFlags.Publicto include public properties in the search.Especifique
BindingFlags.NonPublicpara incluir propriedades não públicas (ou seja, propriedades particulares, internas e protegidas) na pesquisa.SpecifyBindingFlags.NonPublicto include non-public properties (that is, private, internal, and protected properties) in the search.Especifique
BindingFlags.FlattenHierarchypara incluir os membros estáticospubliceprotectedacima na hierarquia; os membros estáticosprivateem classes herdadas não são incluídos.SpecifyBindingFlags.FlattenHierarchyto includepublicandprotectedstatic members up the hierarchy;privatestatic members in inherited classes are not included.
Os seguintes sinalizadores de modificador BindingFlags podem ser usados para alterar como a pesquisa funciona:The following BindingFlags modifier flags can be used to change how the search works:
BindingFlags.IgnoreCasepara ignorar o caso dename.BindingFlags.IgnoreCaseto ignore the case ofname.BindingFlags.DeclaredOnlypara pesquisar somente as propriedades declaradas nas Type Propriedades, não as que foram simplesmente herdadas.BindingFlags.DeclaredOnlyto search only the properties declared on the Type, not properties that were simply inherited.
Consulte System.Reflection.BindingFlags para obter mais informações.See System.Reflection.BindingFlags for more information.