July 2015
Intermediate to advanced
1300 pages
87h 27m
English
In most cases, the .NET built-in serialization engine is good enough. But if it does not meet your particular needs, you can override the serialization process with custom serialization. This means implementing the ISerializable interface that requires the implementation of the GetObjectData method. Such a method is important because it is invoked during serialization. A custom implementation of the class constructor must also be provided. You have to first reproduce at least what built-in formatters do during serialization. The code in Listing 39.2 shows how to provide custom serialization for the Person class.
LISTING 39.2 Providing Custom Serialization
Imports System.Runtime.Serialization ...