31#pragma warning disable CA1720
33#pragma warning restore CA1720
41 public string Value {
get;
private set; }
52 internal int? CellMetadata {
get;
set; }
65 if (value ==
null || type ==
DataType.Empty)
72 Value = NormalizeValue(value, type);
90 private static string NormalizeValue(
string value,
DataType type)
95 if (value ==
"1" || value.Equals(
"true", StringComparison.OrdinalIgnoreCase))
99 if (value ==
"0" || value.Equals(
"false", StringComparison.OrdinalIgnoreCase))
103 throw new ArgumentException(
"An invalid boolean value was provided (0 or 1 are expected): " + value);
ExternalCellValue(string value)
Constructor with value. The type DataType.String will be used as default type.
DataType Type
Type of the external, cached cell value.
DataType
Enum for the data type of the external cell.
@ String
External cell value is a string reference.
@ Boolean
External cell value is boolean.
@ Date
External cell value is date or date and time (ISO 8601).
@ Error
External cell value is an error and not actually a value.
@ Number
External cell value is a number. This is the implicit default, if not specified.
@ Empty
Not a real type for external cells, but used to mark a non-cached cell value. "0" will be shown as ca...
ExternalCellValue(string value, DataType type)
Constructor with value and type.
string Value
Value of the external, cached cell as string representation.