Class OdfFormulaEvaluationSession
Maintains formula dependency and value snapshots for transactional incremental recalculation. 維護公式相依關係與值快照,以進行交易式增量重算。
public sealed class OdfFormulaEvaluationSession
- Inheritance
-
OdfFormulaEvaluationSession
- Inherited Members
Remarks
A session belongs to one spreadsheet document and is not thread-safe. Custom functions, resolvers, and fallbacks configured through the options are caller-trusted code. 工作階段僅屬於一份試算表文件,且不具執行緒安全性。透過選項設定的自訂函式、 resolver 與後援皆屬呼叫端信任的程式碼。
Methods
Invalidate()
Invalidates the retained dependency and value snapshots so the next call performs a full recalculation. 使保留的相依關係與值快照失效,讓下次呼叫執行完整重算。
public void Invalidate()
Recalculate()
Recalculates all formulas on the first call and only affected formulas on later calls. 第一次呼叫會重算所有公式,後續呼叫只重算受影響的公式。
public OdfFormulaEvaluationReport Recalculate()
Returns
- OdfFormulaEvaluationReport
The transactional evaluation report. / 交易式評估報告。
Exceptions
- OdfFormulaEvaluationException
Thrown when strict evaluation fails. / 當嚴格評估失敗時擲出。
Recalculate(CancellationToken)
Recalculates affected formulas transactionally with cancellation. 使用取消權杖,以交易方式重算受影響的公式。
public OdfFormulaEvaluationReport Recalculate(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe cancellation token. / 取消權杖。
Returns
- OdfFormulaEvaluationReport
The transactional evaluation report. / 交易式評估報告。
Exceptions
- OdfFormulaEvaluationException
Thrown when strict evaluation fails. / 當嚴格評估失敗時擲出。
- OperationCanceledException
Thrown when cancellation is requested. / 當要求取消時擲出。