Export (0) Print
Expand All

Lazy<T, TMetadata> Class

Provides an extension of the Lazy<T> class with support for metadata.

System.Object
  System.Lazy<T>
    System.Lazy<T, TMetadata>

Namespace:  System
Assembly:  System.ComponentModel.Composition (in System.ComponentModel.Composition.dll)

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.

  NameDescription
Public methodLazy<T, TMetadata>(TMetadata)Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata.
Public methodLazy<T, TMetadata>(TMetadata, Boolean)Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata and thread safety mode.
Public methodLazy<T, TMetadata>(TMetadata, LazyThreadSafetyMode)Initializes a new instance of the Lazy<T, TMetadata> class with the specified metadata and thread safety mode.
Public methodLazy<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.
Public methodLazy<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.
Public methodLazy<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

  NameDescription
Public propertyIsValueCreatedGets a value that indicates whether a value has been created for this Lazy<T> instance. (Inherited from Lazy<T>.)
Public propertyMetadataGets or sets the metadata associated with the referenced value.
Public propertyValueGets the lazily initialized value of the current Lazy<T> instance. (Inherited from Lazy<T>.)
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringCreates and returns a string representation of the Lazy<T>.Value property for this instance. (Inherited from Lazy<T>.)
Top

For more information about lazy initialization, see Lazy<T>.

Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft