TreeNodeExtensionsProjectTreeToTreeS, D(S, D, ActionS, D, FuncD, D, ActionD, D, Int32, ListValueTupleD, D, Int32) Method |
Projects a source tree onto a destination tree.
Nodes are updated, added, or deleted in the destination tree to match the source tree.
Namespace: Altaxo.CollectionsAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static void ProjectTreeToTree<S, D>(
this S sourceRoot,
D destRoot,
Action<S, D> updateDestinationNodeFromSourceNode,
Func<D, D> createDestinationNode,
Action<D, D, int> deleteDestinationNode,
ref List<(D , D , int )>? destNodesToDelete
)
where S : Object, ITreeNode<S>
where D : Object, ITreeNode<D>
Parameters
- sourceRoot S
- The source root node.
- destRoot D
- The destination root node.
- updateDestinationNodeFromSourceNode ActionS, D
- An action that takes a source node and a destination node and updates the destination node according to the contents of the source node.
- createDestinationNode FuncD, D
- A function that takes a parent destination node as argument and creates a new destination node as a child of that parent. The return value is the newly created node.
- deleteDestinationNode ActionD, D, Int32
- An action that deletes a destination node. First argument is the parent node, the second argument is the destination node to delete, 3rd argument is the index of the child node (as obtained from the order of the child node enumeration).
- destNodesToDelete ListValueTupleD, D, Int32
- A helper collection to collect destination nodes that have to be deleted.
Type Parameters
- S
- Type of the source node.
- D
- Type of the destination node.
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