EnumBuilder.IsDefined(Type, Boolean) Método

Definição

Verifica se o tipo de atributo personalizado especificado é definido.Checks if the specified custom attribute type is defined.

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 objeto Type ao qual os atributos personalizados são aplicados.The Type object to which the custom attributes are applied.

inherit
Boolean

Especifica se deve-se pesquisar ou não a cadeia de herança desse membro para localizar os atributos.Specifies whether to search this member's inheritance chain to find the attributes.

Retornos

Boolean

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

Exceções

Atualmente, esse método não tem suporte em tipos que não estão completos.This method is not currently supported in types that are not complete.

Comentários

Como alternativa, para verificar se um atributo personalizado está definido para um tipo concluído, recupere o tipo usando GetType e chame GetCustomAttributes no retornado Type .As a workaround, to check if a custom attribute is defined for a finished type, retrieve the type using GetType and call GetCustomAttributes on the returned Type.

Aplica-se a