Search Results for

    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
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Flame.Collections
    Assembly: Flame.dll
    Syntax
    public struct DeferredInitializer

    Properties

    | Edit this page View Source

    HasInitialized

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

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

    true if the initializer has run; otherwise, false.

    Methods

    | Edit this page 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
    Action initializer

    The initializer to run once.

    Returns
    Type Description
    DeferredInitializer

    A deferred initializer.

    | Edit this page 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.

    Action<T> initializer

    The initializer to run.

    Returns
    Type Description
    DeferredInitializer

    A deferred initializer.

    Type Parameters
    Name Description
    T
    | Edit this page 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
    bool

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

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX