ModuleBuilder.GetTypeToken Método
Definição
Retorna um token de tipo.Returns a type token.
Sobrecargas
| GetTypeToken(String) |
Retorna o token usado para identificar o tipo com o nome especificado.Returns the token used to identify the type with the specified name. |
| GetTypeToken(Type) |
Retorna o token usado para identificar o tipo especificado neste módulo.Returns the token used to identify the specified type within this module. |
GetTypeToken(String)
Retorna o token usado para identificar o tipo com o nome especificado.Returns the token used to identify the type with the specified name.
public:
System::Reflection::Emit::TypeToken GetTypeToken(System::String ^ name);
public System.Reflection.Emit.TypeToken GetTypeToken (string name);
member this.GetTypeToken : string -> System.Reflection.Emit.TypeToken
Public Function GetTypeToken (name As String) As TypeToken
Parâmetros
- name
- String
O nome da classe, incluindo o namespace.The name of the class, including the namespace.
Retornos
O token usado para identificar o tipo com o nome especificado neste módulo.The token used to identify the type with the specified name within this module.
Exceções
name é a cadeia de caracteres vazia ("").name is the empty string ("").
- ou --or-
name representa um tipo ByRef.name represents a ByRef type.
name é null.name is null.
- ou --or-
O tipo especificado por name não pôde ser encontrado.The type specified by name could not be found.
Este é um módulo não temporário que faz referência a um módulo transitório.This is a non-transient module that references a transient module.
Comentários
Esse método é útil para clientes da MethodRental classe que desejam modificar diretamente o corpo de um método.This method is useful for clients of the MethodRental class who want to directly modify the body of a method.
Aplica-se a
GetTypeToken(Type)
Retorna o token usado para identificar o tipo especificado neste módulo.Returns the token used to identify the specified type within this module.
public:
System::Reflection::Emit::TypeToken GetTypeToken(Type ^ type);
public System.Reflection.Emit.TypeToken GetTypeToken (Type type);
member this.GetTypeToken : Type -> System.Reflection.Emit.TypeToken
Public Function GetTypeToken (type As Type) As TypeToken
Parâmetros
- type
- Type
O objeto de tipo que representa o tipo de classe.The type object that represents the class type.
Retornos
O token usado para identificar o tipo fornecido neste módulo.The token used to identify the given type within this module.
Exceções
type é um tipo ByRef.type is a ByRef type.
type é null.type is null.
Este é um módulo não temporário que faz referência a um módulo transitório.This is a non-transient module that references a transient module.
Comentários
Os tokens são usados em instruções MSIL (Microsoft Intermediate Language) para identificar objetos.Tokens are used in Microsoft intermediate language (MSIL) instructions to identify objects. Os tokens são relativos ao módulo no qual estão contidos.Tokens are relative to the module in which they are contained. Por exemplo, o valor do token para String provavelmente será diferente do módulo para o módulo.For example, the token value for String is likely to be different from module to module. Quando GetTypeToken é invocado, uma referência é adicionada ao módulo.When GetTypeToken is invoked, a reference is added to the module. A referência se torna uma parte permanente do módulo; várias chamadas com o mesmo argumento não têm efeito adicional.The reference becomes a permanent part of the module; multiple calls with the same argument have no additional effect.