Esempio n. 1
0
 private void RaiseRequestTableRow(RequestTableRowEventArgs args)
 {
     if (!IsInStreamingMode)
     {
         throw new InvalidOperationException("Cannot request rows in non streaming mode");
     }
     TableRowRequested(this, args);
 }
            public bool MoveNext()
            {
                if (ExhaustedAllRows)
                {
                    Current = null;
                    return(false);
                }

                if (_internalEnumerator == null)
                {
                    var args = new RequestTableRowEventArgs();
                    _table.RaiseRequestTableRow(args);
                    if (args.Finished)
                    {
                        Current = null;
                    }
                    else
                    {
                        Current = args.Row;
                    }
                }
                else
                {
                    var hasData = _internalEnumerator.MoveNext();
                    Current = (SpreadsheetRow)_internalEnumerator.Current;
                    if (!hasData)
                    {
                        Current = null;
                    }
                }

                if (Current != null)
                {
                    ItemsRead++;
                }
                else
                {
                    ExhaustedAllRows = true;
                    return(false);
                }
                return(true);
            }