Exemple #1
0
 /// <summary>
 /// Reset enumerator. You will need to call MoveNext to get to first record.
 /// </summary>
 public void Reset()
 {
     if (BTree.Count > 0)
     {
         BTree.MoveFirst();
     }
     bWasReset = true;
 }
Exemple #2
0
        /// <summary>
        /// Synchronized Move to first item.
        /// </summary>
        /// <returns>Returns true if able to make 1st item current item or false if not</returns>
        public bool MoveFirst()
        {
            bool b;

            Lock(Collections.BTree.OperationType.Read);
            try
            {
                b = BTree.MoveFirst();
            }
            finally
            {
                Unlock();
            }
            return(b);
        }
Exemple #3
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();
        }