Using ISerializable for custom serialization to a FileStream

If you want more control over what is serialized, you should implement ISerializable on your object. This gives a developer complete control over what is serialized. Note that you still need to add the [ISerializable] attribute to your object. Lastly, the developer also needs to implement a deserialization constructor. Using ISerializable, however, does have a caveat. According to the MSDN, the forward compatibility of your object with newer versions of the .NET Framework and any improvements made to the serialization framework might not be applicable on your object. You also need to implement ISerializable on all the derived types of your object.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.36.38