Does XDocument.Save (line filename) save the entire file or just the changes?
Basically, if I do Xdoc.Load (filename), do some changes, then Xdoc.Save (filename) will only keep things that have changed, like inserted or deleted items, etc., or it keeps everything ?
Depending on the answer, I am considering determining whether my application will save changes or save explicitly and on exit. Also consider whether to write to multiple xml files or just store everything in one big file. I have no idea how big one big file will be, but I suspect it could potentially be 10MB, so if it saves the entire file, I definitely cannot save every change by saving one big file.
If it saves the entire file, does anyone have an opinion on having a separate XML file for each object (potentially hundreds) and is that a good idea?
a source to share
Yes, saving a document saves the entire document.
What is the use case for "per change"? Is this in case the app crashes? If so, I suggest that you save these incremental changes in a temporary directory as small files, but when the user explicitly tells you to save the file, save it in one large file. (It's easier to copy around, etc.) Remove the temp directory on exit.
I'm really wondering if you really need a temporary directory. This sounds like quite a lot of work for little benefit.
a source to share