System.Windows.Forms.TreeNode._GetVisibleNodesAmount C# (CSharp) Метод

_GetVisibleNodesAmount() приватный статический Метод

private static _GetVisibleNodesAmount ( TreeNode node, int currentAmount ) : int
node TreeNode
currentAmount int
Результат int
        private static int _GetVisibleNodesAmount(TreeNode node, int currentAmount)
        {
            if (node.IsVisible) currentAmount++;
            else return currentAmount;

            if (node.IsExpanded)
                for (int i = 0; i < node.Nodes.Count; i++)
                    currentAmount = _GetVisibleNodesAmount(node.Nodes[i], currentAmount);

            return currentAmount;
        }