Table of Contents

Class Hierarchy

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Provides a set of static methods for hierarchy related operations.

public static class Hierarchy
Inheritance
Object
Hierarchy

Methods

Find<T>(IHierarchy<T>, Func<IHierarchy<T>, Boolean>)

Retrieves all nodes that match the conditions defined by the function delegate match.

public static IEnumerable<IHierarchy<T>> Find<T>(IHierarchy<T> hierarchy, Func<IHierarchy<T>, bool> match)

Parameters

hierarchy IHierarchy<T>

The IHierarchy<T> implementation to perform the operation upon.

match Func<IHierarchy<T>, Boolean>

The function delegate that defines the conditions of the nodes to search for.

Returns

IEnumerable<IHierarchy<T>>

An System.Collections.Generic.IEnumerable<T> sequence containing all nodes that match the conditions defined by the specified predicate, if found.

Type Parameters

T

The type of the instance that this node represents.

GetObjectHierarchy(Object, Action<ObjectHierarchyOptions>)

Gets the tree structure of the specified source wrapped in an IHierarchy<T> node representing a hierarchical structure.

public static IHierarchy<object> GetObjectHierarchy(object source, Action<ObjectHierarchyOptions> setup = null)

Parameters

source Object

The source whose properties will be traversed while building the hierarchical structure.

setup Action<ObjectHierarchyOptions>

The ObjectHierarchyOptions which need to be configured.

Returns

IHierarchy<Object>

An IHierarchy<T> node representing the entirety of a hierarchical structure from the specified source.

Exceptions

System.ArgumentNullException

source is null.

WhileSourceTraversalHasElements<TSource>(TSource, Func<TSource, IEnumerable<TSource>>)

Invokes the specified traversal path of source until obstructed by an empty sequence.

public static IEnumerable<TSource> WhileSourceTraversalHasElements<TSource>(TSource source, Func<TSource, IEnumerable<TSource>> traversal)
    where TSource : class

Parameters

source TSource

The source to travel until the traversal path is obstructed by an empty sequence.

traversal Func<TSource, IEnumerable<TSource>>

The function delegate that is invoked until the traveled path is obstructed by an empty sequence.

Returns

IEnumerable<TSource>

An System.Collections.Generic.IEnumerable<T> sequence equal to the traveled path of source.

Type Parameters

TSource

The type of the source.

Exceptions

System.ArgumentNullException

source -or- traversal is null.

WhileSourceTraversalIsNotNull<TSource>(TSource, Func<TSource, TSource>)

Invokes the specified traversal path of source until obstructed by a null value.

public static IEnumerable<TSource> WhileSourceTraversalIsNotNull<TSource>(TSource source, Func<TSource, TSource> traversal)
    where TSource : class

Parameters

source TSource

The source to travel until the traversal path is obstructed by a null value.

traversal Func<TSource, TSource>

The function delegate that is invoked until the traveled path is obstructed by a null value.

Returns

IEnumerable<TSource>

An System.Collections.Generic.IEnumerable<T> sequence equal to the traveled path of source.

Type Parameters

TSource

The type of the source.

Exceptions

System.ArgumentNullException

source -or- traversal is null.