Compartilhar via


Método _Type.GetCustomAttributes (Type, Boolean)

 

Dica

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Fornece objetos COM com acesso independente de versão para o método MemberInfo.GetCustomAttributes.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (em mscorlib.dll)

Sintaxe

object[] GetCustomAttributes(
    Type attributeType,
    bool inherit
)
array<Object^>^ GetCustomAttributes(
    Type^ attributeType,
    bool inherit
)
abstract GetCustomAttributes : 
        attributeType:Type *
        inherit:bool -> Object[]
Function GetCustomAttributes (
    attributeType As Type,
    inherit As Boolean
) As Object()

Parâmetros

  • attributeType
    Type: System.Type

    O tipo de atributo a ser pesquisado. Somente os atributos que podem ser atribuídos a esse tipo são retornados.

  • inherit
    Type: System.Boolean

    Especifica se deve-se pesquisar ou não a cadeia de herança desse membro para localizar os atributos.

Valor Retornado

Type: System.Object[]

Uma matriz de atributos personalizados aplicados a este membro ou uma matriz com zero (0) elementos se nenhum atributo tiver sido aplicado.

Comentários

Este método é para acesso a classes gerenciadas de código não gerenciado e não deve ser chamado em código gerenciado.

O MemberInfo.GetCustomAttributes método retorna todos os atributos aplicados a este membro.

Informações de Versão

.NET Framework
Disponível desde 1.1

Confira Também

GetCustomAttributes Sobrecarga
Interface _Type
Namespace System.Runtime.InteropServices

Retornar ao início