Registers a schedule item class for serialization support.
Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling.Silverlight
C# Copy Code |
---|
public static void RegisterItemClass ( |
Visual Basic Copy Code |
---|
Public Shared Sub RegisterItemClass( _ |
A class identifier to use when saving and loading items of the specified type.
A revision number of the item's class serialization format.
When using custom item classes, use this method to enable saving and loading the custom item objects 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 to the schedule what class instance to create and let it load the subsequent data. The following class identifiers are reserved and should not be used: 'std:appointment', 'std:resource', 'std:contact', 'std:location' and 'std:task'.
The version identifier must be increased when the format in which items are saved changes. It is 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. Failing to do so would result in exceptions during the load process, since the schedule will be unable to create custom items. |
The following example demonstrates how to use custom item classes with the schedule and how to load and save a schedule containing custom items. The example presumes that schedule already references an existing Schedule object.
Running the example should dump the following line to the output console:
Hello, friend!
C# Copy Code |
---|
/// <summary> |
Visual Basic Copy Code |
---|
' <summary> |