Esempio n. 1
0
 internal Cell(Row row, Column column, object value, int styleIndex)
     : base(row.Worksheet, styleIndex)
 {
     Row = row;
     Column = column;
     UpdateCellValue(value);
 }
Esempio n. 2
0
 /***********************************
  * 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;
 }
Esempio n. 3
0
 /***********************************
  * 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;
 }
Esempio n. 4
0
        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];
        }
Esempio n. 5
0
 /// <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);
 }
Esempio n. 6
0
 /// <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;
 }
Esempio n. 7
0
 internal static string GetRangeAddress(Column column1, Column column2, bool fixedReference = false)
 {
     return BaseRange.GetLocalAddress(column1.Name, column2.Name, fixedReference);
 }
Esempio n. 8
0
 public Cell(Row row, Column column)
     : this(row, column, string.Empty)
 {
 }
Esempio n. 9
0
        /// <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;
        }
Esempio n. 10
0
 /// <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);
 }
Esempio n. 11
0
 /// <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;
 }