Esempio n. 1
0
            public bool MoveNext()
            {
                int pos;

                if (m_reverse)
                {
                    pos = ColaStore.IterateFindPrevious(m_items.Levels, m_cursors, m_min, m_max, m_items.Comparer, out m_current);
                }
                else
                {
                    pos = ColaStore.IterateFindNext(m_items.Levels, m_cursors, m_min, m_max, m_items.Comparer, out m_current);
                }

                if (pos == NOT_FOUND)
                {                 // that was the last item!
                    return(false);
                }

                // update the bounds if necessary
                if (pos == m_max)
                {
                    if (m_cursors[m_max] == NOT_FOUND)
                    {
                        --m_max;
                    }
                }
                else if (pos == m_min)
                {
                    if (m_cursors[m_min] == NOT_FOUND)
                    {
                        ++m_min;
                    }
                }

                return(true);
            }