Search Results for

    Show / Hide Table of Contents

    Class DependencyLoopChecker<T>

    Inheritance
    object
    DependencyLoopChecker<T>
    Implements
    IDependencyLoopChecker<T>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Utils
    Assembly: LemonEdge.Utils.dll
    Syntax
    public class DependencyLoopChecker<T> : IDependencyLoopChecker<T>
    Type Parameters
    Name Description
    T

    Constructors

    DependencyLoopChecker(Func<T, DependencyLoopItem<T>>)

    Creates a new DependencyLoopChecker<T>.

    Declaration
    public DependencyLoopChecker(Func<T, DependencyLoopItem<T>> map)
    Parameters
    Type Name Description
    Func<T, DependencyLoopItem<T>> map

    The function that maps T to DependencyLoopItem<T>.

    Methods

    AddDependency(T)

    Adds an item to the internal list for checking.

    Declaration
    public void AddDependency(T item)
    Parameters
    Type Name Description
    T item

    Your item

    HasLoop()

    Checks all items added via AddDependency(T), and breaks at the first loop that is found.

    Declaration
    public bool HasLoop()
    Returns
    Type Description
    bool

    Whether a loop was found

    PrintLooped()

    Prints out the results found after calling HasLoop().

    Declaration
    public (string Output, T?[] Looped) PrintLooped()
    Returns
    Type Description
    (string Output, T[] Looped)

    A string output of the first loop found, and the list of items.

    RemoveLooped()

    Removes the looping items discovered by calling HasLoop(). HasLoop() breaks at the first loop found. Use this to remove that first round of items, then repeat.

    Declaration
    public T?[] RemoveLooped()
    Returns
    Type Description
    T[]

    The removed items

    Reset()

    Resets the internal lists for reuse.

    Declaration
    public void Reset()

    Implements

    IDependencyLoopChecker<T>

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.