System.Runtime.Serialization.ObjectManager Class

Keeps track of objects as they are deserialized.

See Also: ObjectManager Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public class ObjectManager

Remarks

During deserialization, the System.Runtime.Serialization.Formatter queries the System.Runtime.Serialization.ObjectManager to determine whether a reference to an object in the serialized stream refers to an object that has already been deserialized (a backward reference), or to an object that has not yet been deserialized (a forward reference). If the reference in the serialized stream is a forward reference, then the System.Runtime.Serialization.Formatter can register a fixup with the System.Runtime.Serialization.ObjectManager. If the reference in the serialized stream is a backward reference, the System.Runtime.Serialization.Formatter immediately completes the reference. Fixup refers to the process of finalizing object references not already completed during the object deserialization process. After the required object has been deserialized, the System.Runtime.Serialization.ObjectManager will complete the reference.

The System.Runtime.Serialization.ObjectManager follows a set of rules that dictate the fixup order. All objects that implement System.Runtime.Serialization.ISerializable or have a System.Runtime.Serialization.ISerializationSurrogate can expect to have all the objects that they transmitted through System.Runtime.Serialization.SerializationInfo available when the object tree is deserialized. However, a parent object cannot presume that all its child objects will be fully completed when it is fully deserialized. All child objects will be present but not all the grandchild objects will necessarily be present. If an object needs to take certain actions that depend on executing code on its child objects, it can delay these actions, implement the System.Runtime.Serialization.IDeserializationCallback interface, and execute the code only when it is called back on this interface.

Requirements

Namespace: System.Runtime.Serialization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0