SessionEntry
ReferencesRecords the state of a single open document at the time a session snapshot was written. One SessionEntry is created per open document and stored within a SessionRecord.
Constructors
SessionEntry
#Construct a session entry for an unnamed document. The entry tracks the document by its runtime Document.Identity and points at the autosave file under Folders.UnnamedFilesFolder. Unnamed entries are always treated as modified since there is no on-disk original to fall back to.
Parameters:
| identity (Guid) | The document's runtime identity. |
| autoSavePath (string) | Full path to the autosave file under UnnamedFilesFolder. |
| parentEntryIndex (int = -1) | Index of the entry whose document contains the cluster being edited. -1 if this is a top-level unnamed document rather than a cluster inner doc. |
| parentClusterId (Guid = null) | InstanceId of the cluster object inside the parent document whose inner-doc edit this entry represents. Empty when parentEntryIndex is -1. |
SessionEntry
#Deserialisation constructor. Tolerates older records that pre-date the Kind field by defaulting to SessionEntryKind.Named.
Parameters:
| reader (IReader) |
Properties
AutoSavePath
#Full path to the autosave file written for this document at shutdown. For named entries: only meaningful when WasModified is true. For unnamed entries: always set; restore loads from here.
Identity
#Runtime identity of the document. Set only when Kind is SessionEntryKind.Unnamed. Used to reattach the same identity to the restored document so that successive autosaves continue to overwrite the same file under Folders.UnnamedFilesFolder.
OriginalLastWriteUtc
#Last-write timestamp (UTC) of the original file at the moment the session was written. Used during restore to detect external edits between sessions. Only meaningful when Kind is SessionEntryKind.Named.
OriginalPath
#Full path to the original document on disk. Set only when Kind is SessionEntryKind.Named.
ParentClusterId
#InstanceId of the cluster object inside the parent document whose inner-doc edit this entry represents. Empty when ParentEntryIndex is -1. Only meaningful when Kind is SessionEntryKind.Unnamed.
ParentEntryIndex
#Index of the entry whose document contains the cluster being edited. -1 when this entry is a top-level document rather than a cluster inner doc. Only meaningful when Kind is SessionEntryKind.Unnamed.
WasModified
#True if the document had unsaved changes at the moment the session was written. For SessionEntryKind.Unnamed entries this is always true; there is no on-disk original, so any unnamed document being captured must be restored from its autosave file.