FieldBuilder.IsDefined(Type, Boolean) Método

Definição

Indica se um atributo contendo o tipo especificado é definido em um campo.Indicates whether an attribute having the specified type is defined on a field.

public:
 override bool IsDefined(Type ^ attributeType, bool inherit);
public override bool IsDefined (Type attributeType, bool inherit);
override this.IsDefined : Type * bool -> bool
Public Overrides Function IsDefined (attributeType As Type, inherit As Boolean) As Boolean

Parâmetros

attributeType
Type

O tipo do atributo.The type of the attribute.

inherit
Boolean

Controla a herança de atributos personalizados de classes base.Controls inheritance of custom attributes from base classes.

Retornos

Boolean

true se uma ou mais instâncias de attributeType estão definidas nesse campo; caso contrário, false.true if one or more instance of attributeType is defined on this field; otherwise, false.

Exceções

Não há suporte para este método atualmente.This method is not currently supported. Recuperar o campo usando GetField(String, BindingFlags) e chamar IsDefined(Type, Boolean) no FieldInfo retornado.Retrieve the field using GetField(String, BindingFlags) and call IsDefined(Type, Boolean) on the returned FieldInfo.

Aplica-se a