TypedReference 結構

定義

重要

此 API 不符合 CLS 規範。

描述同時包含位置的 Managed 指標和可能儲存於該位置之型別的 Runtime 表示的物件。Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location.

public value class TypedReference
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public struct TypedReference
type TypedReference = struct
Public Structure TypedReference
繼承
TypedReference
屬性

備註

具類型的參考是用於 varargs 和其他支援的類型/值組合。A typed reference is a type/value combination used for varargs and other support. TypedReference是內建的實值型別, 可用於參數和區域變數。TypedReference is a built-in value type that can be used for parameters and local variables.

無法建立TypedReference物件的陣列。Arrays of TypedReference objects cannot be created. 例如, 下列呼叫無效:For example, the following call is invalid:

Assembly::Load("mscorlib.dll")->GetType("System.TypedReference[]");
Assembly.Load("mscorlib.dll").GetType("System.TypedReference[]");
Assembly.Load("mscorlib.dll").GetType("System.TypedReference[]")

方法

Equals(Object)

檢查這個物件是否等於指定的物件。Checks if this object is equal to the specified object.

GetHashCode()

傳回這個物件的雜湊碼。Returns the hash code of this object.

GetTargetType(TypedReference)

傳回指定 TypedReference 的目標型別 (Target Type)。Returns the type of the target of the specified TypedReference.

MakeTypedReference(Object, FieldInfo[])

對由指定物件和欄位描述清單所識別的欄位產生 TypedReferenceMakes a TypedReference for a field identified by a specified object and list of field descriptions.

SetTypedReference(TypedReference, Object)

將指定的值轉換成 TypedReferenceConverts the specified value to a TypedReference. 不支援這個方法。This method is not supported.

TargetTypeToken(TypedReference)

傳回指定的 TypedReference 的內部中繼資料 (Metadata) 型別控制代碼。Returns the internal metadata type handle for the specified TypedReference.

ToObject(TypedReference)

將指定的 TypedReference 轉換成 ObjectConverts the specified TypedReference to an Object.

適用於