1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-03-12 20:42:19 +00:00
Files
6502bench/SourceGen/ProjectFile.cs
Andy McFadden 1b2353c259 Auto-save, part 2
Periodically save the project to the recovery file if changes have
been made and the project is "dirty".

We need to handle a couple of things specially.  If the user uses
"Save As" to change the project name, we need to recreate the recovery
file as well.  If auto-save is enabled or disabled in app settings, we
need to create or discard the recovery file, and possibly change the
timer interval.  If the project is modified, auto-saved, and then the
change is un-done, the project won't be dirty, but will have a stale
recovery file with a newer modification date; we handle this by simply
truncating the stale recovery file.

To reduce the amount of auto-saving, we don't do an initial write to
the recovery file, and we reset the timer every time the user does a
manual save.  A user who saves diligently will always have an empty
recovery file.
2024-08-07 17:55:54 -07:00

63 KiB