ASP.NET Pack Programmer's Guide
DiagramItem.LoadFrom Method
See Also
 





Deserializes the item from the specified reader.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

protected virtual void LoadFrom (
    BinaryReader reader,
    PersistContext context
)

Visual Basic  Copy Code

Protected Overridable 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

This method is invoked when an item is being deserialized from a diagram file saved in a binary format.

 Example

The following example shows how to implement this method in a derived class.

C#  Copy Code

protected override void LoadFrom(System.IO.BinaryReader reader, PersistContext ctx)
{
    base.LoadFrom(reader, ctx);

    label = reader.ReadString();
    icon = ctx.LoadImage();
}

Visual Basic  Copy Code

Protected Overrides Sub LoadFrom(ByVal reader As System.IO.BinaryReader, ByVal ctx As PersistContext)

    MyBase.LoadFrom(reader, ctx)

    title = reader.ReadString()
    imgIcon = ctx.LoadImage()

End Sub

 See Also

DiagramItem Members
DiagramItem Class
MindFusion.Diagramming Namespace