Esempio n. 1
0
        private static void CalculateNumbers(ICell cell)
        {
            if (cell == null)
            {
                throw new ArgumentNullException(nameof(cell));
            }

            if (!ReferenceCellAnalyzer.IsCellReferencePresent(cell.Value) && cell.Type != CellTypeEnum.Error)
            {
                cell.Type         = CellTypeEnum.Number;
                cell.Value        = CellExpression.Calculate(cell);
                cell.IsCalculated = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Converts the cell reference to value.
        /// </summary>
        /// <param name="table">The table.</param>
        /// <param name="cell">The cell.</param>
        /// <exception cref="System.ArgumentNullException">
        /// </exception>
        public static void ConvertCellReferenceToValue(ITable table, ICell cell)
        {
            if (table == null) throw new ArgumentNullException(nameof(table));
            if (cell == null) throw new ArgumentNullException(nameof(cell));

            string[] parts = cell.Value.Split(CellConst.OperationSymbols);

            CheckExpressionParts(cell);

            foreach (string part in parts)
            {
                if (cell.Type != CellTypeEnum.Error && ReferenceCellAnalyzer.IsCellReferencePresent(part))
                {
                    ReplaceReferenceToValue(table, cell, part);
                }
            }
        }