What seems acceptable is to display the save dialog as independent.
Canceling the shutdown and then resuming it later is certainly not an option, due to your condition and others.
Since simply discarding data is unacceptable, there are no other options.
Well, except for saving data to a temporary file, then automatically restoring it the next time the program starts. Rather like MS Word after it crashed. In fact, the more I think this is, the better.
Edit: There is another way, namely: save, for example, the path. MS OneNote does. What struck me before is that provided that you are performing a decent multi-level cancellation in your application, all manual business savings are actually somewhat dated - an anachronism since when disk operations were expensive and error prone, currently mostly old habits.
But I'm distracted. In any case, it is probably not applicable to your application, since I assume that it should be implemented from the very beginning.
source share