Search
Step 7: Enable serialization

In order to enable serialization of custom item types, call the RegisterItemClass method. For example, to enable serialization of IconNode objects, add the following code in your form constructor.

C#  Copy Code

// Enable serialization of IconNode instances
Diagram.RegisterItemClass(typeof(IconNode), "IconNode", 1);

Visual Basic  Copy Code

' Enable serialization of IconNode instances
Diagram.RegisterItemClass(GetType(IconNode), "IconNode", 1)