Ejemplo n.º 1
0
        /// <summary>
        /// Moves to the next object.
        /// </summary>
        /// <returns></returns>
        public bool MoveNext()
        {
            _currentFeatureIndex++;
            if (_currentFeatures != null &&
                _currentFeatureIndex < _currentFeatures.Count)
            { // moved to the next object in the current features list.
                return(true);
            }

            while (true)
            {
                if (!_source.MoveNext())
                {
                    return(false);
                }
                var next         = _source.Current();
                var nextFeatures = _interpreter.Interpret(next);
                _currentFeatures     = new List <IFeature>(nextFeatures.Features);
                _currentFeatureIndex = 0;

                if (_currentFeatures.Count > 0)
                {
                    return(true);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Moves to the next feature.
 /// </summary>
 /// <returns></returns>
 public bool MoveNext()
 {
     if (_currentEnumerator != null &&
         _currentEnumerator.MoveNext())
     { // there is still a current enumerator.
         _current = _currentEnumerator.Current;
         return(true);
     }
     _currentEnumerator = null;
     while (_source.MoveNext())
     {
         var features = _interpreter.Interpret(_source.Current());
         if (features != null)
         { // an object was succesfully converted.
             _currentEnumerator = features.GetEnumerator();
             if (_currentEnumerator.MoveNext())
             { // move to first object in feature collection.
                 _current = _currentEnumerator.Current;
                 return(true);
             }
             else
             { // an empty feature collection, try next one.
                 _currentEnumerator.Dispose();
                 _currentEnumerator = null;
             }
         }
     }
     return(false);
 }