Show / Hide Table of Contents

Class Hierarchy

Provides a set of static methods for hierarchy related operations.

Inheritance
Object
Hierarchy
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class Hierarchy

Methods

| Improve this Doc View Source

Find<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.

| Improve this Doc View Source

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 source.

Exceptions
Type Condition
ArgumentNullException

source is null.

| Improve this Doc View Source

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 traversal path is obstructed by an empty sequence.

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 source.

Type Parameters
Name Description
TSource

The type of the source.

Exceptions
Type Condition
ArgumentNullException

source -or- traversal is null.

| Improve this Doc View Source

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 traversal path is obstructed by a null value.

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 source.

Type Parameters
Name Description
TSource

The type of the source.

Exceptions
Type Condition
ArgumentNullException

source -or- traversal is null.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright 2008-2022 Geekle. All rights reserved. Code with passion and love; deploy with confidence. 👨‍💻️🔥❤️🚀😎
Generated by DocFX