private KeyValuePair <int, SXSSFRow>?flushOneRow() { if (_rows.Count == 0) { return(null); } var firstRow = _rows.FirstOrDefault(); // Update the best fit column widths for auto-sizing just before the rows are flushed // _autoSizeColumnTracker.UpdateColumnWidths(row); _writer.WriteRow(firstRow.Key, firstRow.Value); _rows.Remove(firstRow.Key); lastFlushedRowNumber = firstRow.Key; return(firstRow); }
private void flushOneRow() { int firstRowNum = _rows.FirstOrDefault().Key; if (firstRowNum != null) { int rowIndex = firstRowNum; SXSSFRow row = _rows[firstRowNum]; // Update the best fit column widths for auto-sizing just before the rows are flushed // _autoSizeColumnTracker.UpdateColumnWidths(row); _writer.WriteRow(rowIndex, row); _rows.Remove(firstRowNum); lastFlushedRowNumber = rowIndex; } }
private void FlushOneRow() { KeyValuePair <int, SXSSFRow> firstRow = _rows.FirstOrDefault(); //KeyValuePair is struct, so check value instead of key if (firstRow.Value != null) { int firstRowNum = firstRow.Key; int rowIndex = firstRowNum; SXSSFRow row = _rows[firstRowNum]; // Update the best fit column widths for auto-sizing just before the rows are flushed _autoSizeColumnTracker.UpdateColumnWidths(row); _writer.WriteRow(rowIndex, row); _rows.Remove(firstRowNum); lastFlushedRowNumber = rowIndex; } }
private KeyValuePair <int, SXSSFRow>?flushOneRow() { if (_rows.Count == 0) { return(null); } var firstRowNum = _rows.Keys.Min(); // Update the best fit column widths for auto-sizing just before the rows are flushed var firstRow = _rows[firstRowNum]; _autoSizeColumnTracker.Value?.UpdateColumnWidths(firstRow); _writer.WriteRow(firstRowNum, firstRow); _rows.Remove(firstRowNum); lastFlushedRowNumber = firstRowNum; return(new KeyValuePair <int, SXSSFRow>(firstRowNum, firstRow)); }