src/GenFx.Components/Trees/TreeEntityExtensions.cs
/// <summary>
/// Returns the number of nodes contained in the subtree of the given <paramref name="node"/>.
/// </summary>
Returns the number of nodes contained in the subtree of the given .
Returns the number of nodes contained in the subtree of the given .
private static int GetSubtreeSize(TreeNode? node)
        {
            if (node is null)
            {
                return 0;
            }
            int sum = 1; 
            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                sum += TreeEntityExtensions.GetSubtreeSize(node.ChildNodes[i]);
            }
            return sum;
        }
private static int GetSubtreeSize ( TreeNode ? node ) { if ( node is null ) { return 0 ; } int sum = 1 ; for ( int i = 0 ; i < node . ChildNodes . Count ; i ++ ) { sum += TreeEntityExtensions . GetSubtreeSize ( node . ChildNodes [ i ] ) ; } return sum ; }
Returns the number of nodes contained in the subtree of the given .
Returns the number of nodes contained in the subtree of the given .
// Includes the node passed in.
node
TreeNode?