コード例 #1
0
 // ------------------------------------------------------
 /// <summary>
 /// Creates a new depth first traversal enumerator with the specified
 /// root elements (a forest) and child accessor.
 /// </summary>
 /// <param name="roots">
 /// The root elements of the trees in the forest to be traversed.
 /// </param>
 /// <param name="children">
 /// The method that defines how to access the children of an element
 /// in the tree.
 /// </param>
 public DepthFirstTraversal(
     IEnumerable <T> roots, DepthFirstChildAccessor <T> children)
 {
     this.roots    = roots;
     this.children = children;
 }
コード例 #2
0
        //~ Constructors .....................................................

        // ------------------------------------------------------
        /// <summary>
        /// Creates a new depth first traversal enumerator with the specified
        /// root element and child accessor.
        /// </summary>
        /// <param name="root">
        /// The root element in the tree to be traversed.
        /// </param>
        /// <param name="children">
        /// The method that defines how to access the children of an element
        /// in the tree.
        /// </param>
        public DepthFirstTraversal(
            T root, DepthFirstChildAccessor <T> children)
            :
            this(new T[] { root }, children)
        {
        }