private void GetSheetRecords(List<SheetRecord> sheets, ref SstRecord sst, ref SheetRecord currentSheet, Record record) { SetSST(record, ref sst); SetSheets(sheets, record); currentSheet = SetIndex(sheets, currentSheet, record); SetRow(currentSheet, record); SetCell(currentSheet, record); SetMergeCells(currentSheet, record); }
public XLSRow(RowRecord record, SheetRecord sheet) { Cells = new Dictionary<uint, ICell>(); foreach (var cell in sheet.Cells.Where(i => i.Row == record.RowNumber)) { if (cell is LabelSstRecord) { (cell as LabelSstRecord).SetValue(sheet.SST); } AddCell(cell); } }
private static void SetMergeCells(SheetRecord currentSheet, Record record) { if (record is MergeCellsRecord && currentSheet != null) { currentSheet.MergeCells.Add(record as MergeCellsRecord); } }
private static SheetRecord SetIndex(List<SheetRecord> sheets, SheetRecord currentSheet, Record record) { if (record is IndexRecord) { currentSheet = sheets.FirstOrDefault(i => i.Index == null); if (currentSheet != null) currentSheet.Index = record as IndexRecord; } return currentSheet; }
private static void SetRow(SheetRecord currentSheet, Record record) { if (record is RowRecord && currentSheet != null) { currentSheet.Rows.Add(record as RowRecord); } }
private static void SetCell(SheetRecord currentSheet, Record record) { if (record is CellRecord && currentSheet != null) { currentSheet.Cells.Add(record as CellRecord); } }