FieldBuilder Classe

Definição

Define e representa um campo.Defines and represents a field. Essa classe não pode ser herdada.This class cannot be inherited.

public ref class FieldBuilder sealed : System::Reflection::FieldInfo
public ref class FieldBuilder sealed : System::Reflection::FieldInfo, System::Runtime::InteropServices::_FieldBuilder
public ref class FieldBuilder abstract : System::Reflection::FieldInfo
public sealed class FieldBuilder : System.Reflection.FieldInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class FieldBuilder : System.Reflection.FieldInfo, System.Runtime.InteropServices._FieldBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class FieldBuilder : System.Reflection.FieldInfo, System.Runtime.InteropServices._FieldBuilder
public abstract class FieldBuilder : System.Reflection.FieldInfo
type FieldBuilder = class
    inherit FieldInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type FieldBuilder = class
    inherit FieldInfo
    interface _FieldBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type FieldBuilder = class
    inherit FieldInfo
    interface _FieldBuilder
Public NotInheritable Class FieldBuilder
Inherits FieldInfo
Public NotInheritable Class FieldBuilder
Inherits FieldInfo
Implements _FieldBuilder
Public MustInherit Class FieldBuilder
Inherits FieldInfo
Herança
FieldBuilder
Atributos
Implementações

Exemplos

O exemplo a seguir ilustra o uso da FieldBuilder classe.The following example illustrates the use of the FieldBuilder class.

using System;
using System.Reflection;
using System.Reflection.Emit;

public class FieldBuilder_Sample
{
   private static Type CreateType()
   {
      // Create an assembly.
      AssemblyName assemName = new AssemblyName();
      assemName.Name = "DynamicAssembly";
      AssemblyBuilder assemBuilder =
                     AssemblyBuilder.DefineDynamicAssembly(assemName, AssemblyBuilderAccess.Run);
      // Create a dynamic module in Dynamic Assembly.
      ModuleBuilder modBuilder = assemBuilder.DefineDynamicModule("DynamicModule");
      // Define a public class named "DynamicClass" in the assembly.
      TypeBuilder typBuilder = modBuilder.DefineType("DynamicClass", TypeAttributes.Public);

      // Define a private String field named "DynamicField" in the type.
      FieldBuilder fldBuilder = typBuilder.DefineField("DynamicField",
          typeof(string), FieldAttributes.Private | FieldAttributes.Static);
      // Create the constructor.
      Type[] constructorArgs = { typeof(String) };
      ConstructorBuilder constructor = typBuilder.DefineConstructor(
         MethodAttributes.Public, CallingConventions.Standard, constructorArgs);
      ILGenerator constructorIL = constructor.GetILGenerator();
      constructorIL.Emit(OpCodes.Ldarg_0);
      ConstructorInfo superConstructor = typeof(Object).GetConstructor(new Type[0]);
      constructorIL.Emit(OpCodes.Call, superConstructor);
      constructorIL.Emit(OpCodes.Ldarg_0);
      constructorIL.Emit(OpCodes.Ldarg_1);
      constructorIL.Emit(OpCodes.Stfld, fldBuilder);
      constructorIL.Emit(OpCodes.Ret);

      // Create the DynamicMethod method.
      MethodBuilder methBuilder= typBuilder.DefineMethod("DynamicMethod",
                           MethodAttributes.Public,typeof(String),null);
      ILGenerator methodIL = methBuilder.GetILGenerator();
      methodIL.Emit(OpCodes.Ldarg_0);
      methodIL.Emit(OpCodes.Ldfld, fldBuilder);
      methodIL.Emit(OpCodes.Ret);

      Console.WriteLine($"Name               : {fldBuilder.Name}");
      Console.WriteLine($"DeclaringType      : {fldBuilder.DeclaringType}");
      Console.WriteLine($"Type               : {fldBuilder.FieldType}");
      return typBuilder.CreateType();
   }

   public static void Main()
   {
      Type dynType = CreateType();
      try
      {
         // Create an instance of the "HelloWorld" class.
         Object helloWorld = Activator.CreateInstance(dynType, new Object[] { "HelloWorld" });
         // Invoke the "DynamicMethod" method of the "DynamicClass" class.
         Object obj  = dynType.InvokeMember("DynamicMethod",
                        BindingFlags.InvokeMethod, null, helloWorld, null);
         Console.WriteLine($"DynamicClass.DynamicMethod returned: \"{obj}\"");
      }
      catch(MethodAccessException e)
      {
         Console.WriteLine($"{e.GetType().Name}: {e.Message}");
      }
  }
}
Imports System.Reflection
Imports System.Reflection.Emit

Public Module FieldBuilder_Sample
   Private Function CreateType() As Type
      ' Create an assembly.
      Dim assemName As New AssemblyName()
      assemName.Name = "DynamicAssembly"
      Dim assemBuilder As AssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemName,
                                                AssemblyBuilderAccess.Run)
      ' Create a dynamic module in Dynamic Assembly.
      Dim modBuilder As ModuleBuilder = assemBuilder.DefineDynamicModule("DynamicModule")
      ' Define a public class named "DynamicClass" in the assembly.
      Dim typBuilder As TypeBuilder = modBuilder.DefineType("DynamicClass", 
                                          TypeAttributes.Public)
      ' Define a private String field named "DynamicField" in the type.
      Dim fldBuilder As FieldBuilder = typBuilder.DefineField("DynamicField",
                  GetType(String), FieldAttributes.Private Or FieldAttributes.Static)
      ' Create the constructor.
      Dim constructorArgs As Type() = {GetType(String)}
      Dim constructor As ConstructorBuilder = 
                  typBuilder.DefineConstructor(MethodAttributes.Public, 
                           CallingConventions.Standard, constructorArgs)
      Dim constructorIL As ILGenerator = constructor.GetILGenerator()
      constructorIL.Emit(OpCodes.Ldarg_0)
      Dim superConstructor As ConstructorInfo = GetType(Object).GetConstructor(New Type() {})
      constructorIL.Emit(OpCodes.Call, superConstructor)
      constructorIL.Emit(OpCodes.Ldarg_0)
      constructorIL.Emit(OpCodes.Ldarg_1)
      constructorIL.Emit(OpCodes.Stfld, fldBuilder)
      constructorIL.Emit(OpCodes.Ret)

      ' Create the DynamicMethod method.
      Dim methBuilder As MethodBuilder = typBuilder.DefineMethod("DynamicMethod", 
                        MethodAttributes.Public, GetType(String), Nothing)
      Dim methodIL As ILGenerator = methBuilder.GetILGenerator()
      methodIL.Emit(OpCodes.Ldarg_0)
      methodIL.Emit(OpCodes.Ldfld, fldBuilder)
      methodIL.Emit(OpCodes.Ret)

      Console.WriteLine($"Name               : {fldBuilder.Name}")
      Console.WriteLine($"DeclaringType      : {fldBuilder.DeclaringType}")
      Console.WriteLine($"Type               : {fldBuilder.FieldType}")
      Return typBuilder.CreateType()
   End Function 

   Public Sub Main()
      Dim dynType As Type = CreateType()
      Try  
        ' Create an instance of the "HelloWorld" class.
         Dim helloWorld As Object = Activator.CreateInstance(dynType, New Object() {"HelloWorld"})
         ' Invoke the "DynamicMethod" method of the "DynamicClass" class.
         Dim obj As Object = dynType.InvokeMember("DynamicMethod", 
                  BindingFlags.InvokeMethod, Nothing, helloWorld, Nothing)
         Console.WriteLine($"DynamicClass.DynamicMethod returned: ""{obj}""")
      Catch e As MethodAccessException
            Console.WriteLine($"{e.GetType().Name}: {e.Message}")
      End Try
   End Sub 
End Module

Comentários

Obtenha uma instância do FieldBuilder chamando DefineField , DefineInitializedData ou DefineUninitializedData .Get an instance of FieldBuilder by calling DefineField, DefineInitializedData, or DefineUninitializedData.

Observação

SetValueNão há suporte para o método no momento.The SetValue method is currently not supported. Como alternativa, recupere o FieldInfo refletindo no tipo concluído e chame SetValue para definir o valor do campo.As a workaround, retrieve the FieldInfo by reflecting on the finished type and call SetValue to set the value of the field.

Construtores

FieldBuilder()

Propriedades

Attributes

Indica os atributos desse campo.Indicates the attributes of this field. Esta propriedade é somente para leitura.This property is read-only.

CustomAttributes

Obtém uma coleção que contém os atributos personalizados desse membro.Gets a collection that contains this member's custom attributes.

(Herdado de MemberInfo)
DeclaringType

Indica uma referência para o objeto Type para o tipo que declara esse membro.Indicates a reference to the Type object for the type that declares this field. Esta propriedade é somente para leitura.This property is read-only.

FieldHandle

Indica o identificador de metadados internos para esse campo.Indicates the internal metadata handle for this field. Esta propriedade é somente para leitura.This property is read-only.

FieldHandle

Obtém um RuntimeFieldHandle, que é um identificador para a representação interna de metadados de um campo.Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field.

(Herdado de FieldInfo)
FieldType

Indica o objeto Type que representa o tipo desse campo.Indicates the Type object that represents the type of this field. Esta propriedade é somente para leitura.This property is read-only.

IsAssembly

Obtém um valor que indica se a visibilidade potencial deste campo é ou não descrita por Assembly, ou seja, que o campo está visível no máximo para outros tipos no mesmo assembly, não estando visível para tipos derivados fora do assembly.Gets a value indicating whether the potential visibility of this field is described by Assembly; that is, the field is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly.

(Herdado de FieldInfo)
IsCollectible

Obtém um valor que indica se este objeto MemberInfo faz parte de um assembly mantido em uma coleção AssemblyLoadContext.Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext.

(Herdado de MemberInfo)
IsFamily

Obtém um valor que indica se a visibilidade do campo é ou não descrita por Family, ou seja, que o campo está visível somente dentro de sua classe e das classes derivadas.Gets a value indicating whether the visibility of this field is described by Family; that is, the field is visible only within its class and derived classes.

(Herdado de FieldInfo)
IsFamilyAndAssembly

Obtém um valor que indica se a visibilidade do campo é ou não descrita por FamANDAssem, ou seja, o campo pode ser acessado de classes derivadas, mas somente se elas estiverem no mesmo assembly.Gets a value indicating whether the visibility of this field is described by FamANDAssem; that is, the field can be accessed from derived classes, but only if they are in the same assembly.

(Herdado de FieldInfo)
IsFamilyOrAssembly

Obtém um valor que indica se a visibilidade potencial desse campo é ou não descrita por FamORAssem, ou seja, o campo pode ser acessado por classes derivadas independentemente da localização delas, bem como por classes no mesmo assembly.Gets a value indicating whether the potential visibility of this field is described by FamORAssem; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly.

(Herdado de FieldInfo)
IsInitOnly

Obtém um valor que indica se o campo só pode ser definido no corpo do construtor.Gets a value indicating whether the field can only be set in the body of the constructor.

(Herdado de FieldInfo)
IsLiteral

Obtém um valor que indica se o valor é gravado no tempo de compilação e não pode ser alterado.Gets a value indicating whether the value is written at compile time and cannot be changed.

(Herdado de FieldInfo)
IsNotSerialized

Obtém um valor que indica se esse campo tem o atributo NotSerialized.Gets a value indicating whether this field has the NotSerialized attribute.

(Herdado de FieldInfo)
IsPinvokeImpl

Obtém um valor que indica se o atributo PinvokeImpl correspondente está definido em FieldAttributes.Gets a value indicating whether the corresponding PinvokeImpl attribute is set in FieldAttributes.

(Herdado de FieldInfo)
IsPrivate

Obtém um valor que indica se o campo é ou não privado.Gets a value indicating whether the field is private.

(Herdado de FieldInfo)
IsPublic

Obtém um valor que indica se o campo é ou não público.Gets a value indicating whether the field is public.

(Herdado de FieldInfo)
IsSecurityCritical

Obtém um valor que indica se o campo atual é crítico para segurança ou crítico para segurança e disponível no código transparente no nível de confiança atual.Gets a value that indicates whether the current field is security-critical or security-safe-critical at the current trust level.

(Herdado de FieldInfo)
IsSecuritySafeCritical

Obtém um valor que indica se o campo atual é crítico para segurança e disponível no código transparente no nível de confiança atual.Gets a value that indicates whether the current field is security-safe-critical at the current trust level.

(Herdado de FieldInfo)
IsSecurityTransparent

Obtém um valor que indica se o campo atual é transparente no nível de confiança atual.Gets a value that indicates whether the current field is transparent at the current trust level.

(Herdado de FieldInfo)
IsSpecialName

Obtém um valor que indica se o atributo SpecialName correspondente está definido no enumerador FieldAttributes.Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttributes enumerator.

(Herdado de FieldInfo)
IsStatic

Obtém um valor que indica se o campo é ou não estático.Gets a value indicating whether the field is static.

(Herdado de FieldInfo)
MemberType

Obtém um valor MemberTypes que indica que esse membro é um campo.Gets a MemberTypes value indicating that this member is a field.

(Herdado de FieldInfo)
MetadataToken

Obtém um valor que identifica um elemento de metadados.Gets a value that identifies a metadata element.

(Herdado de MemberInfo)
Module

Obtém o módulo no qual o tipo que contém esse campo está sendo definido.Gets the module in which the type that contains this field is being defined.

Module

Obtém o módulo no qual o tipo que declara o membro representado pelo MemberInfo atual está definido.Gets the module in which the type that declares the member represented by the current MemberInfo is defined.

(Herdado de MemberInfo)
Name

Indica o nome desse campo.Indicates the name of this field. Esta propriedade é somente para leitura.This property is read-only.

ReflectedType

Indica a referência para o objeto Type do qual esse objeto foi definido.Indicates the reference to the Type object from which this object was obtained. Esta propriedade é somente para leitura.This property is read-only.

ReflectedType

Obtém o objeto de classe que foi usado para obter esta instância de MemberInfo.Gets the class object that was used to obtain this instance of MemberInfo.

(Herdado de MemberInfo)

Métodos

Equals(Object)

Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object.

(Herdado de FieldInfo)
GetCustomAttributes(Boolean)

Retorna todos os atributos personalizados definidos para esse campo.Returns all the custom attributes defined for this field.

GetCustomAttributes(Boolean)

Quando substituído em uma classe derivada, retorna uma matriz de todos os atributos personalizados aplicados a esse membro.When overridden in a derived class, returns an array of all custom attributes applied to this member.

(Herdado de MemberInfo)
GetCustomAttributes(Type, Boolean)

Retorna todos os atributos personalizados definidos para esse campo identificado pelo tipo fornecido.Returns all the custom attributes defined for this field identified by the given type.

GetCustomAttributes(Type, Boolean)

Quando substituído em uma classe derivada, retorna uma matriz de atributos personalizados aplicados a esse membro e identificados por Type.When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type.

(Herdado de MemberInfo)
GetCustomAttributesData()

Retorna uma lista de objetos CustomAttributeData que representam dados sobre os atributos que foram aplicados ao membro de destino.Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

(Herdado de MemberInfo)
GetHashCode()

Retorna o código hash para a instância.Returns the hash code for this instance.

(Herdado de FieldInfo)
GetOptionalCustomModifiers()

Obtém uma matriz de tipos que identificam os modificadores personalizados opcionais do campo.Gets an array of types that identify the optional custom modifiers of the field.

(Herdado de FieldInfo)
GetRawConstantValue()

Retorna um valor literal associado ao campo por um compilador.Returns a literal value associated with the field by a compiler.

(Herdado de FieldInfo)
GetRequiredCustomModifiers()

Obtém uma matriz de tipos que identificam os modificadores personalizados requeridos da propriedade.Gets an array of types that identify the required custom modifiers of the property.

(Herdado de FieldInfo)
GetToken()

Retorna o token que representa esse campo.Returns the token representing this field.

GetType()

Descobre os atributos de um campo de classe e fornece acesso aos metadados de campo.Discovers the attributes of a class field and provides access to field metadata.

(Herdado de FieldInfo)
GetValue(Object)

Recupera o valor do campo com suporte no objeto especificado.Retrieves the value of the field supported by the given object.

GetValueDirect(TypedReference)

Retorna o valor de um campo com suporte no objeto especificado.Returns the value of a field supported by a given object.

(Herdado de FieldInfo)
HasSameMetadataDefinitionAs(MemberInfo) (Herdado de MemberInfo)
IsDefined(Type, Boolean)

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.

IsDefined(Type, Boolean)

Quando substituído em uma classe derivada, indica se um ou mais atributos do tipo especificado ou de seus tipos derivados são aplicados a esse membro.When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member.

(Herdado de MemberInfo)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
SetConstant(Object)

Define o novo valor padrão desse campo.Sets the default value of this field.

SetCustomAttribute(ConstructorInfo, Byte[])

Define um atributo personalizado usando um blob de atributo personalizado especificado.Sets a custom attribute using a specified custom attribute blob.

SetCustomAttribute(CustomAttributeBuilder)

Define um atributo personalizado usando um construtor de atributos personalizados.Sets a custom attribute using a custom attribute builder.

SetMarshal(UnmanagedMarshal)
Obsoleto.
Obsoleto.

Descreve o marshaling nativo do campo.Describes the native marshaling of the field.

SetOffset(Int32)

Especifica o layout do campo.Specifies the field layout.

SetValue(Object, Object)

Define o valor do campo com suporte no objeto especificado.Sets the value of the field supported by the given object.

(Herdado de FieldInfo)
SetValue(Object, Object, BindingFlags, Binder, CultureInfo)

Define o valor do campo com suporte no objeto especificado.Sets the value of the field supported by the given object.

SetValue(Object, Object, BindingFlags, Binder, CultureInfo)

Quando substituído em uma classe derivada, define o valor do campo com suporte por um determinado objeto.When overridden in a derived class, sets the value of the field supported by the given object.

(Herdado de FieldInfo)
SetValueDirect(TypedReference, Object)

Define o valor do campo com suporte no objeto especificado.Sets the value of the field supported by the given object.

(Herdado de FieldInfo)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Implantações explícitas de interface

_FieldBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers.

_FieldBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface.

_FieldBuilder.GetTypeInfoCount(UInt32)

Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1).

_FieldBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object.

_FieldInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers.

(Herdado de FieldInfo)
_FieldInfo.GetType()

Obtém um objeto Type que representa o tipo FieldInfo.Gets a Type object representing the FieldInfo type.

(Herdado de FieldInfo)
_FieldInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Herdado de FieldInfo)
_FieldInfo.GetTypeInfoCount(UInt32)

Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Herdado de FieldInfo)
_FieldInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object.

(Herdado de FieldInfo)
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers.

(Herdado de MemberInfo)
_MemberInfo.GetType()

Obtém um objeto Type que representa a classe MemberInfo.Gets a Type object representing the MemberInfo class.

(Herdado de MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera as informações do tipo de um objeto, que podem ser usadas para obter informações de tipo para uma interface.Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Herdado de MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32)

Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Herdado de MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object.

(Herdado de MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Boolean)

Retorna uma matriz de todos os atributos personalizados definidos neste membro, exceto atributos nomeados ou então uma matriz vazia, se não houver nenhum atributo personalizado.Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.

(Herdado de MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)

Retorna uma matriz de atributos personalizados definidos neste membro, identificados por tipo ou então uma matriz vazia, se não houver nenhum atributo personalizado desse tipo.Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type.

(Herdado de MemberInfo)
ICustomAttributeProvider.IsDefined(Type, Boolean)

Indica se uma ou mais instâncias de attributeType estão definidas nesse membro.Indicates whether one or more instance of attributeType is defined on this member.

(Herdado de MemberInfo)

Métodos de Extensão

GetCustomAttribute(MemberInfo, Type)

Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado.Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute(MemberInfo, Type, Boolean)

Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttribute<T>(MemberInfo)

Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado.Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute<T>(MemberInfo, Boolean)

Recupera um atributo personalizado de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo)

Recupera uma coleção de atributos personalizados que são aplicados a um membro especificado.Retrieves a collection of custom attributes that are applied to a specified member.

GetCustomAttributes(MemberInfo, Boolean)

Recupera uma coleção de atributos personalizados aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo, Type)

Recupera uma coleção de atributos personalizados de um tipo especificado que são aplicados a um membro especificado.Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes(MemberInfo, Type, Boolean)

Recupera uma coleção de atributos personalizados de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes<T>(MemberInfo)

Recupera uma coleção de atributos personalizados de um tipo especificado que são aplicados a um membro especificado.Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes<T>(MemberInfo, Boolean)

Recupera uma coleção de atributos personalizados de um tipo especificado aplicado a um membro especificado e opcionalmente inspeciona os ancestrais desse membro.Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

IsDefined(MemberInfo, Type)

Indica se os atributos personalizados de um tipo especificados são aplicados a um membro especificado.Indicates whether custom attributes of a specified type are applied to a specified member.

IsDefined(MemberInfo, Type, Boolean)

Indica se os atributos personalizados de um tipo especificado são aplicados a um membro especificado e, opcionalmente, aplicados a seus ancestrais.Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

GetMetadataToken(MemberInfo)

Obtém um token de metadados para o membro fornecido, se disponível.Gets a metadata token for the given member, if available.

HasMetadataToken(MemberInfo)

Retorna um valor que indica se um token de metadados está disponível para o membro especificado.Returns a value that indicates whether a metadata token is available for the specified member.

Aplica-se a