Exemple #1
0
        /// <summary>
        /// Synchronized Move to next item.
        /// </summary>
        /// <returns>Returns true if able to make next item current item or false if not</returns>
        public bool MoveNext()
        {
            bool b;

            Lock(Collections.BTree.OperationType.Read);
            try
            {
                b = BTree.MoveNext();
            }
            finally
            {
                Unlock();
            }
            return(b);
        }
Exemple #2
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();
        }
Exemple #3
0
 /// <summary>
 /// Make the next record current
 /// </summary>
 /// <returns>Returns true if successful, false otherwise</returns>
 public bool MoveNext()
 {
     if (!bWasReset)
     {
         return(BTree.MoveNext());
     }
     else
     {
         if (BTree.Count == 0)
         {
             return(false);
         }
         bWasReset = false;
         return(true);
     }
 }