Ejemplo n.º 1
0
        /// <summary>
        /// Copy constructor. This causes the new instance to copy the 'BTree' instance<br/>
        /// passed as parameter. All items are copied including Comparer object and sort order.
        /// NOTE: Items stored on the Tree are not duplicated.
        /// </summary>
        /// <param name="BTree">BTree object you want to duplicate all its btree graph into this new btree instance</param>
        public BTree(BTree BTree)
        {
            btree          = new BTreeAlgorithm((ValidSlotLengths)BTree.btree.SlotLength, BTree.btree.Comparer);
            this.SortOrder = BTree.SortOrder;

            BTree.MoveFirst();
            while (true)
            {
                btree.Add(BTree.CurrentEntry);
                if (!BTree.MoveNext())
                {
                    break;
                }
            }
            btree.MoveFirst();
        }