Table of Contents

FindSingle Method

Definition

FindSingle<T>(IDecorator<IHierarchy<T>>, Func<IHierarchy<T>, bool>)

Returns the only node that match the conditions defined by the function delegate match, or a default value if no node is found; this method throws an exception if more than one node is found.

public static IHierarchy<T> FindSingle<T>(this IDecorator<IHierarchy<T>> decorator, Func<IHierarchy<T>, bool> match)

Parameters

decorator IDecorator<IHierarchy<T>>

The decorator that wraps the IHierarchy<T> to extend.

match Func<IHierarchy<T>, bool>

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

Returns

IHierarchy<T>

An IHierarchy<T> node that match the conditions defined by the function delegate match, or a default value if no node is found.

Type Parameters

T

The type of the instance that this node represents.