Search
CompositeNode.LoadFrom Method
See Also
 





DiagramItem.LoadFrom override.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

protected override void LoadFrom (
    BinaryReader reader,
    PersistContext context
)

Visual Basic  Copy Code

Protected Overrides Sub LoadFrom( _
    reader As BinaryReader, _
    context As PersistContext _
)

 Parameters

reader
A BinaryReader object from which to read the item's data.
context
A PersistContext object providing contextual information about the serialization process and some helper serialization methods.

 Remarks

By default, all components of a CompositeNode are saved in the stream 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 that expose component attributes. The recommended approach of serializing such classes is to override SerializeComponents and return false to stop the built-in serialization of components, and save / load the node properties from the SaveTo / LoadFrom overrides. This is demonstrated in EmployeeNode.cs in the Demo sample project.

 See Also