FunctionArguments
public sealed class FunctionArguments
Namespace SharpCell · package SharpCell
The arguments of one call of a function added through Workbook.Functions. Valid only while the function runs.
Properties
Caller
public Cell? Caller { get; }
The cell whose formula makes the call; null when the formula was given to Workbook.Evaluate.
CancellationToken
public CancellationToken CancellationToken { get; }
The token passed to Workbook.Recalculate or Workbook.Evaluate, for a slow function to stop early: an OperationCanceledException it throws once the token is cancelled cancels the calculation.
Count
public int Count { get; }
How many arguments the call has, omitted ones included.
Culture
public CultureInfo Culture { get; }
The workbook's culture, as used for converting between text and numbers.
DateSystem
public DateSystem DateSystem { get; }
The workbook's date system, for reading date arguments with CellValue.AsDateTime.
this[int]
public CellValue this[int index] { get; }
The argument's value: a single cell's value, a range as an CellValueKind.Array, an error as an error value, and CellValue.Missing for an argument left out, as the middle one of F(1,,2). An array is a copy the function may change.
Exceptions
ArgumentOutOfRangeException: There is no such argument.
Methods
Boolean(int)
public CellValue Boolean(int index)
The argument converted to a logical value as Excel converts it: TRUE or FALSE, or the error to return.
IsMissing(int)
public bool IsMissing(int index)
Whether the argument was left out, as the middle one of F(1,,2).
Number(int)
public CellValue Number(int index)
The argument converted to a number as Excel converts it (text such as "2" included; an omitted argument is 0): a number, or the error to return, such as #VALUE! for "abc".
Text(int)
public CellValue Text(int index)
The argument converted to text as Excel converts it: text, or the error to return.