private void AdjustArraySize(int index) { if (index > (base.Items.Count - 1)) { ExcelColumnCollection.ExceptionIfColumnOutOfRange(index); int num = index - (base.Items.Count - 1); for (int i = 0; i < num; i++) { base.Items.Add(new ExcelCell(base.Parent)); } } }
internal CellRange(ExcelWorksheet parent, int firstRow, int firstColumn, int lastRow, int lastColumn) : base(parent) { ExcelRowCollection.ExceptionIfRowOutOfRange(firstRow); ExcelColumnCollection.ExceptionIfColumnOutOfRange(firstColumn); ExcelRowCollection.ExceptionIfRowOutOfRange(lastRow); ExcelColumnCollection.ExceptionIfColumnOutOfRange(lastColumn); if (lastRow < firstRow) { throw new ArgumentOutOfRangeException("", lastRow, "Argument lastRow can't be smaller than firstRow."); } if (lastColumn < firstColumn) { throw new ArgumentOutOfRangeException("", lastColumn, "Argument lastColumn can't be smaller than firstColumn."); } this.firstRow = firstRow; this.firstColumn = firstColumn; this.lastRow = lastRow; this.lastColumn = lastColumn; }