Invoked to query whether the underlying component structure should be automatically serialized.
Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming
C# Copy Code |
---|
protected virtual bool SerializeComponents () |
Visual Basic Copy Code |
---|
Protected Overridable Function SerializeComponents () As Boolean |
true to automatically serialize the component tree; false to skip the automatic component serialization.
By default, all components of a CompositeNode are saved along with their associated data. This will lead to wasted space if the instances of a derived class are built upon the same hierarchy of components and expose only a few properties corresponding to component attributes. The recommended approach of serializing such classes is to override SerializeComponents and return false to stop the built-in serialization of components. Then you can save or load only the necessary node properties from SaveTo / LoadFrom overrides for binary format, or SaveToXml / LoadFromXml for XML format. This is demonstrated in EmployeeNode.cs in the Demo sample project.