Ejemplo n.º 1
0
 /// <summary>
 /// Returns an enumerable collection of <see cref="TreeNode"/> objects containing the nodes
 /// of the tree sorted in postfix order.
 /// </summary>
 /// <param name="node"><see cref="TreeNode"/> to start at.</param>
 /// <returns>An enumerable collection of <see cref="TreeNode"/> objects containing the nodes
 /// of the tree sorted in prefix order.</returns>
 private static IEnumerable <TreeNode> GetPostfixTree(TreeNode?node)
 {
     if (node != null)
     {
         foreach (TreeNode childNode in node.ChildNodes)
         {
             foreach (TreeNode subChildNode in TreeEntityExtensions.GetPostfixTree(childNode))
             {
                 yield return(subChildNode);
             }
         }
         yield return(node);
     }
 }