public ExcelRow GetRow(UInt32 rowIndex) { if (rowIndex < 1) { throw new ArgumentException("Index row can not be less than 1!"); } if (this.List.ContainsKey(rowIndex)) { return(this.List[rowIndex]); } Row newRow = new Row() { RowIndex = rowIndex }; ExcelRow nextRow = this.List.FirstOrDefault(p => p.Key > rowIndex).Value; if (nextRow != null) { sheet.worksheet.GetFirstChild <SheetData>().InsertBefore(newRow, nextRow.row); } else { sheet.worksheet.GetFirstChild <SheetData>().Append(newRow); } ExcelRow retVal = new ExcelRow(newRow, sheet); this.List.Add(rowIndex, retVal); return(retVal); }
public ExcelCellCollection(ExcelRow row) { this.row = row; this.List = new SortedDictionary <uint, ExcelCell>(); foreach (Cell cell in row.row.Elements <Cell>()) { ExcelCell newCell = new ExcelCell(cell, row); this.List.Add(newCell.Index, newCell); } }
public ExcelRow GetRow(UInt32 rowIndex) { if (rowIndex < 1) throw new ArgumentException("Index row can not be less than 1!"); if (this.List.ContainsKey(rowIndex)) return this.List[rowIndex]; Row newRow = new Row() { RowIndex = rowIndex }; ExcelRow nextRow = this.List.FirstOrDefault(p => p.Key > rowIndex).Value; if(nextRow != null) sheet.worksheet.GetFirstChild<SheetData>().InsertBefore(newRow, nextRow.row); else sheet.worksheet.GetFirstChild<SheetData>().Append(newRow); ExcelRow retVal = new ExcelRow(newRow, sheet); this.List.Add(rowIndex, retVal); return retVal; }
public ExcelCellCollection(ExcelRow row) { this.row = row; this.List = new SortedDictionary<uint, ExcelCell>(); foreach (Cell cell in row.row.Elements<Cell>()) { ExcelCell newCell = new ExcelCell(cell, row); this.List.Add(newCell.Index, newCell); } }
public ExcelCell(Cell cell, ExcelRow row) { this.row = row; this.cell = cell; }