private static void DivideDataIntoChunks() { int numEntries = GetNumEntries(); BoltsDeliveryContentType lastContentType = BoltsDeliveryContentType.Null; string lastStandardEntry = string.Empty; List <StringColumn> newColumns = ColumnUtils.GetClonedColumns(_list); for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) { BoltsDeliveryContentType entryType = GetEntryContentType(entryIndex); string standardEntry = _list.Columns.First().GetLastChunk().Entries.ElementAt(entryIndex); if (entryType == BoltsDeliveryContentType.Null) { continue; } if (entryType != lastContentType || !lastStandardEntry.Equals(standardEntry)) { AddDataChunks(newColumns); } AddEntry(entryIndex, newColumns); lastContentType = entryType; lastStandardEntry = standardEntry; } _list.Columns = newColumns; }
private static List <StringColumn> GetDividedData() { List <StringColumn> dividedColumns = ColumnUtils.GetClonedColumns(_list); List <StringColumn> originalColumns = _list.Columns; int numEntries = originalColumns.ElementAt(1).GetLastChunk().Entries.Count; for (int entryIndex = 0; entryIndex < numEntries; entryIndex++) { string assemblyEntry = originalColumns.First().GetLastChunk().Entries.ElementAt(entryIndex); if (!string.IsNullOrEmpty(assemblyEntry)) { StartNewChunk(dividedColumns); } for (int columnIndex = 0; columnIndex < dividedColumns.Count; columnIndex++) { string entry = originalColumns.ElementAt(columnIndex).GetLastChunk().Entries.ElementAt(entryIndex); dividedColumns.ElementAt(columnIndex).GetLastChunk().AddEntry(entry); } } return(dividedColumns); }