Click or drag to resize

TreeNodeExtensionsProjectTreeToNewTreeS, D(S, IListInt32, FuncS, IListInt32, D, ActionD, D) Method

Projects a tree (source tree) to a new tree (destination tree). The creation function for the new tree nodes gets information about the node indices.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static D ProjectTreeToNewTree<S, D>(
	this S sourceRoot,
	IList<int> indices,
	Func<S, IList<int>, D> createDestinationNodeFromSourceNode,
	Action<D, D> addChildToDestinationNode
)
where S : Object, ITreeNode<S>
where D : Object, ITreeNode<D>

Parameters

sourceRoot  S
The source root tree node.
indices  IListInt32
List of indices that describes the destination root node. If this parameter is null, an internal list will be created, and the destination root node will get the index 0.
createDestinationNodeFromSourceNode  FuncS, IListInt32, D
Function used to create a destination node from a source node. First parameter is the source node, 2nd parameter is a list of indices that describe the destination node.
addChildToDestinationNode  ActionD, D
Procedure to add a child node to a destination node (first argument is the parent node, 2nd argument is the child node).

Type Parameters

S
Type of the source tree node.
D
Type of the destination tree node.

Return Value

D
The root node of the newly created destination tree that reflects the structure of the source tree.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type S. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also