public static ExcelElement <Column>[] GetHeaders(this ExcelElement <Row> row)
        {
            if (row.IsEmpty())
            {
                return(Array.Empty <ExcelElement <Column> >());
            }

            var cells   = row.GetRowCells();
            var headers = cells.Select(cell => new ExcelElement <Column>(row.Doc, new Column(cell))).ToArray();

            return(headers);
        }
        public static string[] GetRowValues(
            this ExcelElement <Row> row,
            ExcelElement <Column>[] headers,
            IParserProvider parserProvider,
            string nullValue = null)
        {
            if (row.IsEmpty())
            {
                return(Array.Empty <string>());
            }

            var cells = row.GetRowCells();

            string[] rowValues = new string[headers.Length];
            for (int i = 0; i < headers.Length; i++)
            {
                var header = headers[i];
                // Find cell for the same column.
                var cell = cells.FirstOrDefault(c => c.Data.CellReference.GetColumnReference() == header.Data.ColumnReference);

                if (cell != null)
                {
                    // Set propertyParser for cell according column name
                    var propertyParser = parserProvider.GetParsers().FirstOrDefault(parser => parser.SourceName == header.Data.Name);
                    if (propertyParser != null)
                    {
                        cell.SetMetadata(propertyParser);
                    }

                    rowValues[i] = cell.GetCellValue(nullValue);
                }
                else
                {
                    rowValues[i] = nullValue;
                }
            }

            return(rowValues);
        }