MindFusion.Wpf Pack Programmer's Guide
Diagram.RegisterItemClass Method (Type, String, Int32)
See Also
 





Registers a diagram item class for serialization support.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public static void RegisterItemClass (
    Type itemClass,
    string classId,
    int classVersion
)

Visual Basic  Copy Code

Public Shared Sub RegisterItemClass( _
    itemClass As Type, _
    classId As String, _
    classVersion As Integer _
)

 Parameters

itemClass
A Type instance identifying the item class.
classId

A class identifier to use when saving and loading items of the specified type.

classVersion

A revision number of the item's class serialization format.

 Remarks

When using custom item types, use this method to enable saving and loading the custom item instances to/from XML or binary files. The class id string is written before each item's data, and when loading items later that string indicates what class instance to create and let it load the subsequent data. The following class identifiers are reserved and should not be used by your application: "std:DiagramLink", "std:ShapeNode", "std:TableNode", "std:ContainerNode" and "std:ControlNode".

The version identifier must be increased when the format in which items are saved changes. It can be used when loading files to let your application load items data from an older format.

 Note

All custom item classes must provide a parameterless constructor, or one that takes a Diagram argument. Failing to do so would result in exceptions during the load process, since the diagram will be unable to create items from the custom type.

 See Also

RegisterItemClass Method Overload List
Diagram Members
Diagram Class
MindFusion.Diagramming.Wpf Namespace