コード例 #1
0
            /// <summary>
            /// Advances the enumerator to the next record of the CSV.
            /// </summary>
            /// <returns><see langword="true"/> if the enumerator was successfully advanced to the next record, <see langword="false"/> if the enumerator has passed the end of the CSV.</returns>
            public bool MoveNext()
            {
                if (_reader._currentRecordIndex != _currentRecordIndex)
                    throw new InvalidOperationException(ExceptionMessage.EnumerationVersionCheckFailed);

                if (_reader.ReadNextRecord())
                {
                    _current = new string[_reader._fieldCount];

                    _reader.CopyCurrentRecordTo(_current);
                    _currentRecordIndex = _reader._currentRecordIndex;

                    return true;
                }
                else
                {
                    _current = null;
                    _currentRecordIndex = _reader._currentRecordIndex;

                    return false;
                }
            }