I am planning to use serialization to do clone. I have to make my class ISerializable. But how about its super classes and all referenced variable classes? do I need to make them all ISerializable?
If I use ISerializable. I have to implement the GetObjectData(), what I should put inside that method? leave it empty is ok?
The GetObjectData() let you control the serialization process.
Example:
The example above show you how to deserialize and serialize. As you can see GetObjectData is required to deserialize. If you leave it empty, your object won’t have the desire values.