internal Cell(Row row, Column column, object value, int styleIndex) : base(row.Worksheet, styleIndex) { Row = row; Column = column; UpdateCellValue(value); }
/*********************************** * CONSTRUCTORS ************************************/ // internal for time being - until full styling is required. internal Cell(Row row, Column column, object value, CellDataType cellDataType, int styleIndex) : base(row.Worksheet, styleIndex) { // this constructor should be merged with the one below Row = row; Column = column; CellDataType = cellDataType; _value = value; }
/*********************************** * CONSTRUCTORS ************************************/ internal ColumnRange(Column startColumn, Column endColumn) { Worksheet = startColumn.Worksheet; MinIndex = startColumn.Index; MaxIndex = endColumn.Index; StyleIndex = startColumn.StyleIndex; Width = startColumn.Width; IsBestFit = startColumn.IsBestFit; IsCustomWidth = startColumn.IsCustomWidth; }
public Cell(Row row, Column column, object value) : this(row, column, value, CellFormat.DefaultStyleIndex) { // take row or column format if they exist // I can't find anything in the XML files to say which takes precedence if they both exist, so go with row //if (row.RowFormat.CellFormatId > CellFormat.DefaultCellFormatId) // CellFormat = row.RowFormat; //else if (column.ColumnFormat.CellFormatId > CellFormat.DefaultCellFormatId) // CellFormat = column.ColumnFormat; //else // CellFormat = row.Worksheet.Workbook.Styles.CellFormats[CellFormat.DefaultCellFormatId]; }
/// <summary> /// Determines whether the specified Column is equal to the current Column in all respects but index and Worksheet. /// </summary> public bool Similar(Column column) { return ( //column.EqualsStyle(this) && column.IsBestFit == IsBestFit && column.IsCustomWidth == IsCustomWidth && column.Width == Width); }
/// <summary> /// Creates a copy of the Column and assigns to the given Worksheet. /// </summary> public Column Clone(Worksheet worksheet) { Column newColumn = new Column(worksheet, Index, StyleIndex, Width, IsBestFit, IsCustomWidth); return newColumn; }
internal static string GetRangeAddress(Column column1, Column column2, bool fixedReference = false) { return BaseRange.GetLocalAddress(column1.Name, column2.Name, fixedReference); }
public Cell(Row row, Column column) : this(row, column, string.Empty) { }
/// <summary> /// Copies and pastes the Cell to the given address. Overwrites existing target Cell. /// </summary> public Cell CopyTo(Row row, Column column) { if (row.Worksheet != column.Worksheet) throw new Exception("Error in Cell.CopyTo(row, column). Row and column worksheets do not match"); Cell newCell = Clone(row, column); row.Worksheet.Cells[row.Index, column.Index] = newCell; return newCell; }
/// <summary> /// Creates a copy of the Cell and assigns to the given Column. /// </summary> public Cell Clone(Column column) { return Clone(column.Worksheet.Rows[Row.Index], column); }
/// <summary> /// Creates a copy of the Cell and assigns to the given Row and Column. /// </summary> public Cell Clone(Row row, Column column) { Cell newCell = new Cell(row, column, Value, StyleIndex); return newCell; }