| TreeHelperGetSelfAndAncestorsT Method |
Gets the given node and its ancestors.
Namespace: DigitalRune.LinqAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static IEnumerable<T> GetSelfAndAncestors<T>(
T node,
Func<T, T> getParent
)
where T : class
Public Shared Function GetSelfAndAncestors(Of T As Class) (
node As T,
getParent As Func(Of T, T)
) As IEnumerable(Of T)
public:
generic<typename T>
where T : ref class
static IEnumerable<T>^ GetSelfAndAncestors(
T node,
Func<T, T>^ getParent
)
static member GetSelfAndAncestors :
node : 'T *
getParent : Func<'T, 'T> -> IEnumerable<'T> when 'T : not struct
Parameters
- node
- Type: T
The reference node where to start the search. (The reference node will be the first node in
the resulting enumeration.)
- 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. GetSelfAndAncestorsT(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:
IEnumerableT
The
node and its ancestors (along the path from the node to the root).
Exceptions See Also