ModuleHandle.ResolveTypeHandle 方法

定義

傳回中繼資料語彙基元所識別的型別之執行階段型別控制代碼。

多載

ResolveTypeHandle(Int32)

傳回指定之中繼資料語彙基元所識別的型別之執行階段型別控制代碼。

ResolveTypeHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])

傳回指定之中繼資料語彙基元所識別的型別之執行階段型別控制代碼,並指定此語彙基元所屬範圍中的型別和方法的泛型型別引數。

ResolveTypeHandle(Int32)

傳回指定之中繼資料語彙基元所識別的型別之執行階段型別控制代碼。

public:
 RuntimeTypeHandle ResolveTypeHandle(int typeToken);
public RuntimeTypeHandle ResolveTypeHandle (int typeToken);
member this.ResolveTypeHandle : int -> RuntimeTypeHandle
Public Function ResolveTypeHandle (typeToken As Integer) As RuntimeTypeHandle

參數

typeToken
Int32

識別模組內型別的中繼資料語彙基元。

傳回

RuntimeTypeHandle

typeToken 所識別的型別之 RuntimeTypeHandle

例外狀況

在目前的模組中,typeToken 對於型別而言並不是有效的中繼資料語彙基元。

-或- metadataToken 在目前模組的範圍中不是型別的語彙基元。

-或- metadataTokenTypeSpec,其簽章包含項目型別 varmvar

此方法是在空的型別控制代碼上呼叫。

備註

若要解析其簽章包含專案型 var 別或 mvar 的中繼資料權杖 TypeSpec ,請使用 ResolveTypeHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) 方法多載,這可讓您提供必要的內容。

注意

您可以在 Common Language Infrastructure (CLI) 檔中找到中繼資料權杖的相關資訊,特別是「分割區 II:元資料定義和語意」。

適用於

ResolveTypeHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])

傳回指定之中繼資料語彙基元所識別的型別之執行階段型別控制代碼,並指定此語彙基元所屬範圍中的型別和方法的泛型型別引數。

public:
 RuntimeTypeHandle ResolveTypeHandle(int typeToken, cli::array <RuntimeTypeHandle> ^ typeInstantiationContext, cli::array <RuntimeTypeHandle> ^ methodInstantiationContext);
public RuntimeTypeHandle ResolveTypeHandle (int typeToken, RuntimeTypeHandle[]? typeInstantiationContext, RuntimeTypeHandle[]? methodInstantiationContext);
public RuntimeTypeHandle ResolveTypeHandle (int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext);
member this.ResolveTypeHandle : int * RuntimeTypeHandle[] * RuntimeTypeHandle[] -> RuntimeTypeHandle
Public Function ResolveTypeHandle (typeToken As Integer, typeInstantiationContext As RuntimeTypeHandle(), methodInstantiationContext As RuntimeTypeHandle()) As RuntimeTypeHandle

參數

typeToken
Int32

識別模組內型別的中繼資料語彙基元。

typeInstantiationContext
RuntimeTypeHandle[]

RuntimeTypeHandle 結構的陣列,表示此語彙基元所屬範圍中的型別之泛型型別引數;如果該型別不是泛型,則為 null

methodInstantiationContext
RuntimeTypeHandle[]

RuntimeTypeHandle 結構物件的陣列,表示此語彙基元所屬範圍中的方法之泛型型別引數;如果該方法不是泛型,則為 null

傳回

RuntimeTypeHandle

typeToken 所識別的型別之 RuntimeTypeHandle

例外狀況

在目前的模組中,typeToken 對於型別而言並不是有效的中繼資料語彙基元。

-或- metadataToken 在目前模組的範圍中不是型別的語彙基元。

-或- metadataTokenTypeSpec,其簽章包含項目型別 varmvar

此方法是在空的型別控制代碼上呼叫。

typeToken 不是有效的權杖。

備註

注意

您可以在 Common Language Infrastructure (CLI) 檔中找到中繼資料權杖的相關資訊,特別是「分割區 II:元資料定義和語意」。

適用於