Click or drag to resize
DigitalRuneTreeHelperGetRootT Method
Gets the root of a tree.

Namespace: DigitalRune.Linq
Assembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax
public static T GetRoot<T>(
	T node,
	Func<T, T> getParent
)
where T : class

Parameters

node
Type: T
The reference node where to start the search.
getParent
Type: SystemFuncT, T

A method that retrieves the parent object for a node of type T.

The method should return to indicate that a node does not have a parent. GetRootT(T, FuncT, T) guarantees that getParent is never called with as parameter.

Type Parameters

T
The type of node that is enumerated.

Return Value

Type: T
The root node.
Exceptions
ExceptionCondition
ArgumentNullExceptionnode is .
ArgumentNullExceptiongetParent is .
See Also