Lazy<T, TMetadata> Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Provides an extension of the Lazy<T> class with support for metadata.
Inheritance Hierarchy
System.Object
System.Lazy<T>
System.Lazy<T, TMetadata>
Namespace: System
Assembly: System.ComponentModel.Composition (in System.ComponentModel.Composition.dll)
Syntax
'Declaration
Public Class Lazy(Of T, TMetadata) _
Inherits Lazy(Of T)
public class Lazy<T, TMetadata> : Lazy<T>
Type Parameters
- T
Specifies the type of object that is being lazily initialized.
- TMetadata
Specifies the type of metadata for the object being lazily initialized.
The Lazy<T, TMetadata> type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Lazy<T, TMetadata>(TMetadata) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata. | |
Lazy<T, TMetadata>(TMetadata, Boolean) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata and thread safety mode. | |
Lazy<T, TMetadata>(TMetadata, LazyThreadSafetyMode) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata and thread safety mode. | |
Lazy<T, TMetadata>(Func<T>, TMetadata) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata and factory for the referenced value. | |
Lazy<T, TMetadata>(Func<T>, TMetadata, Boolean) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata, factory for the referenced value, and thread safety mode. | |
Lazy<T, TMetadata>(Func<T>, TMetadata, LazyThreadSafetyMode) | Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata, factory for the referenced value, and thread safety mode. |
Top
Properties
Name | Description | |
---|---|---|
IsValueCreated | Gets a value that indicates whether a value has been created for this Lazy<T> instance. (Inherited from Lazy<T>.) | |
Metadata | Gets or sets the metadata associated with the referenced value. | |
Value | Gets the lazily initialized value of the current Lazy<T> instance. (Inherited from Lazy<T>.) |
Top
Methods
Name | Description | |
---|---|---|
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Creates and returns a string representation of the Lazy<T>.Value property for this instance. (Inherited from Lazy<T>.) |
Top
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.