TypedReference 结构

定义

重要

此 API 不符合 CLS。

描述既包含指向某位置的托管指针,也包含该位置可能存储的类型的运行时表示形式的对象。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 的目标类型。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 的内部元数据类型句柄。Returns the internal metadata type handle for the specified TypedReference.

ToObject(TypedReference)

将指定 TypedReference 转换为 ObjectConverts the specified TypedReference to an Object.

适用于