Show / Hide Table of Contents

    Struct DeferredInitializer

    A type of object that guarantees thread-safe, on-demand initialization. An initialization action is only executed once.

    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Flame.Collections
    Assembly: Flame.dll
    Syntax
    public struct DeferredInitializer

    Properties

    | Improve this Doc View Source

    HasInitialized

    Gets a boolean that determines whether the initializer has run or not.

    Declaration
    public bool HasInitialized { get; }
    Property Value
    Type Description
    System.Boolean

    true if the initializer has run; otherwise, false.

    Methods

    | Improve this Doc View Source

    Create(Action)

    Creates a deferred initializer that executes a particular initialization action once.

    Declaration
    public static DeferredInitializer Create(Action initializer)
    Parameters
    Type Name Description
    System.Action initializer

    The initializer to run once.

    Returns
    Type Description
    DeferredInitializer

    A deferred initializer.

    | Improve this Doc View Source

    Create<T>(T, Action<T>)

    Creates a deferred initializer that runs a particular initializer once on a particular value.

    Declaration
    public static DeferredInitializer Create<T>(T instance, Action<T> initializer)
    Parameters
    Type Name Description
    T instance

    A value to initialize.

    System.Action<T> initializer

    The initializer to run.

    Returns
    Type Description
    DeferredInitializer

    A deferred initializer.

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Initialize()

    Ensures that the initializer has run. This will run the initializer if it has not run before and do nothing otherwise.

    Declaration
    public bool Initialize()
    Returns
    Type Description
    System.Boolean

    true if the initializer was run just now; otherwise, false.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX