Ejemplo n.º 1
0
        public override bool MoveNext()
        {
            int updatePosition = _position + (_reverse ? -1 : +1);

            if (updatePosition >= 0 && updatePosition < _collection.GetItems().Count)
            {
                _position = updatePosition;
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        public ConcreteIterator(ConcreteCollection collection, bool reverse)
        {
            _collection = collection;
            _reverse    = reverse;

            if (_reverse)
            {
                this._position = _collection.GetItems().Count;
            }
        }