| TreeHelperGetDepthT Method |
Gets the depth of the specified node in a tree.
Namespace: DigitalRune.LinqAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static int GetDepth<T>(
T node,
Func<T, T> getParent
)
where T : class
Public Shared Function GetDepth(Of T As Class) (
node As T,
getParent As Func(Of T, T)
) As Integer
public:
generic<typename T>
where T : ref class
static int GetDepth(
T node,
Func<T, T>^ getParent
)
static member GetDepth :
node : 'T *
getParent : Func<'T, 'T> -> int when 'T : not struct
Parameters
- node
- Type: T
The node. - 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. GetDepthT(T, FuncT, T) guarantees that getParent is never
called with as parameter.
Type Parameters
- T
- The type of tree node.
Return Value
Type:
Int32The depth of the node.
Exceptions Remarks
The depth of a node is the length of the longest upward path to the root. A root node has a
depth of 0.
See Also