Lazy<T,TMetadata> 类

定义

提供对对象及其关联的元数据的延迟间接引用,以供 Managed Extensibility Framework 使用。Provides a lazy indirect reference to an object and its associated metadata for use by the Managed Extensibility Framework.

generic <typename T, typename TMetadata>
public ref class Lazy : Lazy<T>
[System.Serializable]
public class Lazy<T,TMetadata> : Lazy<T>
type Lazy<'T, 'Metadata> = class
    inherit Lazy<'T>
Public Class Lazy(Of T, TMetadata)
Inherits Lazy(Of T)

类型参数

T

所引用对象的类型。The type of the object referenced.

TMetadata

元数据的类型。The type of the metadata.

继承
Lazy<T,TMetadata>
属性

构造函数

Lazy<T,TMetadata>(Func<T>, TMetadata)

使用指定的元数据初始化 Lazy<T,TMetadata> 类的新实例,该实例使用指定函数来获取所引用对象。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata that uses the specified function to get the referenced object.

Lazy<T,TMetadata>(Func<T>, TMetadata, Boolean)

使用指定的元数据和线程安全值初始化 Lazy<T,TMetadata> 类的新实例,该实例使用指定函数来获取所引用对象。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata and thread safety value that uses the specified function to get the referenced object.

Lazy<T,TMetadata>(Func<T>, TMetadata, LazyThreadSafetyMode)

使用指定的元数据和线程同步模式初始化 Lazy<T,TMetadata> 类的新实例,该实例使用指定函数来获取所引用对象。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata and thread synchronization mode that uses the specified function to get the referenced object.

Lazy<T,TMetadata>(TMetadata)

使用指定的元数据初始化 Lazy<T,TMetadata> 类的新实例。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata.

Lazy<T,TMetadata>(TMetadata, Boolean)

使用指定的元数据和线程安全值初始化 Lazy<T,TMetadata> 类的新实例。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata and thread safety value.

Lazy<T,TMetadata>(TMetadata, LazyThreadSafetyMode)

使用指定的元数据和线程同步模式初始化 Lazy<T,TMetadata> 类的新实例。Initializes a new instance of the Lazy<T,TMetadata> class with the specified metadata and thread synchronization mode.

属性

IsValueCreated

获取一个值,该值指示是否已为此 Lazy<T> 实例创建一个值。Gets a value that indicates whether a value has been created for this Lazy<T> instance.

(继承自 Lazy<T>)
Metadata

获取与引用的对象关联的元数据。Gets the metadata associated with the referenced object.

Value

获取当前 Lazy<T> 实例的延迟初始化值。Gets the lazily initialized value of the current Lazy<T> instance.

(继承自 Lazy<T>)

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

创建并返回此实例的 Value 属性的字符串表示形式。Creates and returns a string representation of the Value property for this instance.

(继承自 Lazy<T>)

适用于