Serialize method is called on a
formatter], object serialization proceeds according to the following sequence of rules:
A check is made to determine whether the formatter has a surrogate selector. If the formatter does, check whether the surrogate selector handles objects of the given type. If the selector handles the object type,
ISerializable.GetObjectDatais called on the surrogate selector.
If there is no surrogate selector or if it does not handle the object type, a check is made to determine whether the object is marked with the
Serializableattribute. If the object is not, a
If the object is marked appropriately, check whether the object implements the
ISerializablinterface. If the object does,
GetObjectDatais called on the object.
If the object does not implement
ISerializable, the default serialization policy is used, serializing all fields not marked as