private int CalMaxLevel( TreeNode currentNode )
{
if( currentNode == null )
{
return -1;
}
int level = 1;
int maxLevel = 0;
foreach( TreeNode node in currentNode.Childrens )
{
level = CalMaxLevel( node ) + 1 ;
if( maxLevel < level)
{
maxLevel = level;
}
}
return maxLevel;
}