|
Streaming support event.
property OnSaveNode: TVTSaveNodeEvent;
This event is triggered whenever a certain node must be serialized into a stream, e.g. for saving to file or for copying to another tree/node during a clipboard or drag'n drop operation. Make sure you only store non-transient data into the stream. Pointers (including long/wide string references) are transient and the application cannot assume to find the data a pointer references on saving at the same place when the node is loaded (see also OnLoadNode). This is even more essential for nodes which are moved or copied between different trees in different processes (applications). Storing strings however is easily done by writing the strings as a whole into the stream.
For exchanging data between different trees and for general stability improvement I strongly recommend that you insert a
kind of identifier as first stream entry when saving a node. This identifier can then be used to determine what data will
follow when loading the node later and does normally not required to be stored in the node data.
OnLoadNode, LoadFromStream, SaveToStream, AddFromStream, VTTreeStreamVersion, TVTHeader.LoadFromStream, TVTHeader.SaveToStream
What do you think about this topic? Send feedback!
|