Tracks whether a transactional root — a Workbook, or a standalone Sheet — has unsaved
changes, by comparing the store's current commit against a saved bookmark commit.
Dirty is a pure commit-id comparison, which has two nice consequences for free:
Undoing back to the saved commit becomes clean again (the store restores the prior commit id).
Selection / view-only changes are non-transactional, so they never create a commit and never
mark the root dirty.
It is consumer-owned: construct it, and call close when done. It is intentionally never
attached to the model. Pass an ITransaction.ICommitSource (e.g. WorkbookIO) and it marks
itself clean automatically on a matching persist; otherwise call markSaved directly.
Tracks whether a transactional root — a
Workbook, or a standaloneSheet— has unsaved changes, by comparing the store's current commit against a saved bookmark commit.Remarks
A peer to TransactionUndoManager: both attach to an ITransaction.IStore and interpret its commits. This one answers "am I dirty relative to the last save?".
Dirty is a pure commit-id comparison, which has two nice consequences for free:
It is consumer-owned: construct it, and call close when done. It is intentionally never attached to the model. Pass an ITransaction.ICommitSource (e.g.
WorkbookIO) and it marks itself clean automatically on a matching persist; otherwise call markSaved directly.