src/GenFx.Components/Trees/TreeHelper.cs
/// <summary>
/// Sets the <see cref="TreeNode.Tree"/> property for the children of <paramref name="parentNode"/>.
/// </summary>
/// <param name="parentNode"><see cref="TreeNode"/> whose children should be set.</param>
Sets the  property for the children of .
Sets the property for the children of .
public static void SetTreeForChildNodes(TreeNode parentNode)
        {
            if (parentNode == null)
            {
                throw new ArgumentNullException(nameof(parentNode));
            }
            for (int i = 0; i < parentNode.ChildNodes.Count; i++)
            {
                TreeNode? childNode = parentNode.ChildNodes[i];
                if (childNode != null)
                {
                    childNode.Tree = parentNode.Tree;
                    SetTreeForChildNodes(childNode);
                }
            }
        }
public static void SetTreeForChildNodes ( TreeNode parentNode ) { if ( parentNode == null ) { throw new ArgumentNullException ( nameof ( parentNode ) ) ; } for ( int i = 0 ; i < parentNode . ChildNodes . Count ; i ++ ) { TreeNode ? childNode = parentNode . ChildNodes [ i ] ; if ( childNode != null ) { childNode . Tree = parentNode . Tree ; SetTreeForChildNodes ( childNode ) ; } } }
Sets the  property for the children of .
Sets the property for the children of .
parentNode
TreeNode
whose children should be set.
whose children should be set .