Beispiel #1
0
        public IList <T> ReadAllLines <T>(int zeroBasedStartRowIndex, Func <IRowCellsReader, T> rowToObjectConvertor)
        {
            var      numberOfRows = _sheet.Dimension.Rows;
            List <T> results      = new List <T>();

            for (int i = zeroBasedStartRowIndex; zeroBasedStartRowIndex < numberOfRows; zeroBasedStartRowIndex++)
            {
                RowCellsReader rowCellsReader = new RowCellsReader(_sheet, zeroBasedStartRowIndex, FileName, SheetName, _logger);
                results.Add(rowToObjectConvertor.Invoke(rowCellsReader));
            }
            return(results);
        }
Beispiel #2
0
        public T ReadLine <T>(int zeroBasedRowIndex, Func <IRowCellsReader, T> rowToObjectConvertor)
        {
            RowCellsReader rowCellsReader = new RowCellsReader(_sheet, zeroBasedRowIndex, FileName, SheetName, _logger);

            return(rowToObjectConvertor.Invoke(rowCellsReader));
        }