9using System.Collections.Generic;
19 public class FormulaData : IEquatable<FormulaData>, IComparable<FormulaData>
21 private string expression;
48 private bool hasExternalReferences;
58 get {
return expression; }
71 get {
return hasExternalReferences; }
74 hasExternalReferences = value;
75 Features.SetFormulaFeatures(definedNameReference ==
null ?
false :
true, hasExternalReferences);
95 get {
return definedNameReference; }
98 definedNameReference = value;
99 Features.SetFormulaFeatures(definedNameReference ==
null ?
false :
true, hasExternalReferences);
124 internal FeatureSet Features {
get;
private set; } = FeatureSet.CreateFormula();
145 public FormulaData(
string expression,
object cachedValue =
null) : this()
160 internal static Cell.CellType ResolveCachedValueType(
object cachedValue)
162 if (cachedValue ==
null)
166 if (cachedValue is
bool)
170 if (cachedValue is
byte || cachedValue is sbyte || cachedValue is decimal || cachedValue is
double
171 || cachedValue is
float || cachedValue is
int || cachedValue is uint || cachedValue is
long
172 || cachedValue is ulong || cachedValue is
short || cachedValue is ushort)
174 return Cell.CellType.Number;
176 if (cachedValue is DateTime)
178 return Cell.CellType.Date;
180 if (cachedValue is TimeSpan)
182 return Cell.CellType.Time;
184 if (cachedValue is Errors.FormulaError)
186 return Cell.CellType.Error;
188 return Cell.CellType.String;
200 data.Type = this.
Type;
205 data.Features = this.Features.Copy();
265 if (ReferenceEquals(
this, other))
270 &&
Type == other.Type
298 hash = (hash * 31) +
Type.GetHashCode();
Class representing a cell of a worksheet.
CellType
Enum defines the basic data types of a cell.
Class representing a defined name within a workbook. A defined name is a descriptive text that repres...
Class providing static methods to parse string values to specific types or to print object as languag...