Class Hierarchy
Provides a set of static methods for hierarchy related operations.
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class Hierarchy
Methods
| Improve this Doc View SourceFind<T>(IHierarchy<T>, Func<IHierarchy<T>, Boolean>)
Retrieves all nodes that match the conditions defined by the function delegate match
.
Declaration
public static IEnumerable<IHierarchy<T>> Find<T>(IHierarchy<T> hierarchy, Func<IHierarchy<T>, bool> match)
Parameters
Type | Name | Description |
---|---|---|
IHierarchy<T> | hierarchy | The IHierarchy<T> implementation to perform the operation upon. |
Func<IHierarchy<T>, Boolean> | match | The function delegate that defines the conditions of the nodes to search for. |
Returns
Type | Description |
---|---|
IEnumerable<IHierarchy<T>> | An IEnumerable<T> sequence containing all nodes that match the conditions defined by the specified predicate, if found. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static IHierarchy<object> GetObjectHierarchy(object source, Action<ObjectHierarchyOptions> setup = null)
Parameters
Type | Name | Description |
---|---|---|
Object | source | The source whose properties will be traversed while building the hierarchical structure. |
Action<ObjectHierarchyOptions> | setup | The ObjectHierarchyOptions which need to be configured. |
Returns
Type | Description |
---|---|
IHierarchy<Object> | An IHierarchy<T> node representing the entirety of a hierarchical structure from the specified |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
WhileSourceTraversalHasElements<TSource>(TSource, Func<TSource, IEnumerable<TSource>>)
Invokes the specified traversal
path of source
until obstructed by an empty sequence.
Declaration
public static IEnumerable<TSource> WhileSourceTraversalHasElements<TSource>(TSource source, Func<TSource, IEnumerable<TSource>> traversal)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The source to travel until the |
Func<TSource, IEnumerable<TSource>> | traversal | The function delegate that is invoked until the traveled path is obstructed by an empty sequence. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | An IEnumerable<T> sequence equal to the traveled path of |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
WhileSourceTraversalIsNotNull<TSource>(TSource, Func<TSource, TSource>)
Invokes the specified traversal
path of source
until obstructed by a null value.
Declaration
public static IEnumerable<TSource> WhileSourceTraversalIsNotNull<TSource>(TSource source, Func<TSource, TSource> traversal)
where TSource : class
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The source to travel until the |
Func<TSource, TSource> | traversal | The function delegate that is invoked until the traveled path is obstructed by a null value. |
Returns
Type | Description |
---|---|
IEnumerable<TSource> | An IEnumerable<T> sequence equal to the traveled path of |
Type Parameters
Name | Description |
---|---|
TSource | The type of the |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|