src/GenFx.Components/Trees/TreeNode.cs
/// <summary>
/// Copies the state from this <see cref="TreeNode"/> to <paramref name="node"/>.
/// </summary>
/// <param name="node"><see cref="TreeNode"/> to which state is to be copied.</param>
/// <param name="newTree"><see cref="TreeEntityBase"/> to which the <paramref name="node"/> should be assigned.</param>
/// <param name="newParentNode"><see cref="TreeNode"/> to be assigned as the parent node of the <paramref name="node"/>.</param>
/// <remarks>
/// <para>
/// The default implementation of this method is to copy the state of <see cref="TreeNode"/>
/// to the <see cref="TreeNode"/> passed in.
/// </para>
/// <para>
/// <b>Notes to inheritors:</b> When overriding this method, it is necessary to call the
/// <b>CopyTo</b> method of the base class.  This method should be used in conjunction with
/// the <see cref="TreeNode.Clone(TreeEntityBase, TreeNode)"/> method.
/// </para>
/// </remarks>
/// <exception cref="ArgumentNullException"><paramref name="node"/> is null.</exception>
/// <exception cref="ArgumentNullException"><paramref name="newTree"/> is null.</exception>
Copies the state from this  to .
Copies the state from this to .
public virtual void CopyTo(TreeNode node, TreeEntityBase newTree, TreeNode? newParentNode)
        {
            if (node is null)
            {
                throw new ArgumentNullException(nameof(node));
            }
            if (newTree is null)
            {
                throw new ArgumentNullException(nameof(newTree));
            }
            for (int i = 0; i < this.childNodes.Count; i++)
            {
                TreeNode? child = childNodes[i];
                if (child != null)
                {
                    node.ChildNodes.Add(child.Clone(newTree, node));
                }
            }
            node.ParentNode = newParentNode;
            node.Tree = newTree;
            node.Value = this.nodeValue;
        }
public virtual void CopyTo ( TreeNode node , TreeEntityBase newTree , TreeNode ? newParentNode ) { if ( node is null ) { throw new ArgumentNullException ( nameof ( node ) ) ; } if ( newTree is null ) { throw new ArgumentNullException ( nameof ( newTree ) ) ; } for ( int i = 0 ; i < this . childNodes . Count ; i ++ ) { TreeNode ? child = childNodes [ i ] ; if ( child != null ) { node . ChildNodes . Add ( child . Clone ( newTree , node ) ) ; } } node . ParentNode = newParentNode ; node . Tree = newTree ; node . Value = this . nodeValue ; }
Copies the state from this  to .
Copies the state from this to .
None
None
node
TreeNode
to which state is to be copied.
to which state is to be copied .
newTree
TreeEntityBase
to which the  should be assigned.
to which the should be assigned .
newParentNode
TreeNode?
to be assigned as the parent node of the .
to be assigned as the parent node of the .
remarks
The default implementation of this method is to copy the state of
to the  passed in.
Notes to inheritors:CopyTo method.
The default implementation of this method is to copy the state of to the passed in . Notes to inheritors : CopyTo method .