public IEnumerable<IList<CellData>> Rows()
{
if (_source == null) yield break;
var rowsData = new List<List<CellData>>();
foreach (var row in _source)
{
var list = new List<CellData>();
foreach (var rowObjects in row.GetType().GetProperties())
{
var columnObject = rowObjects.GetPropertyValue(row);
if (columnObject is IEnumerable)
{
processIEnumerables(list, columnObject);
}
else
{
processNormalProperties(list, columnObject);
}
}
if (!_topFieldsAreVariableInEachRow)
{
yield return list;
}
else
{
//we need to know the largest row, because top fields are variable in each row
rowsData.Add(list);
}
}
if (_topFieldsAreVariableInEachRow)
{
foreach (var list in rowsData)
{
modifyRowInsertVariableFields(list);
yield return list;
}
}
}