Registers an object as it is deserialized.
[Visual Basic] Overloads Overridable Public Sub RegisterObject( _ ByVal obj As Object, _ ByVal objectID As Long _ ) [C#] public virtual void RegisterObject( object obj, long objectID ); [C++] public: virtual void RegisterObject( Object* obj, __int64 objectID ); [JScript] public function RegisterObject( obj : Object, objectID : long );
Exception Type | Condition |
---|---|
ArgumentNullException | The obj parameter is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | The objectID parameter is less than or equal to zero. |
SerializationException | The objectID has already been registered for an object other than obj. |
ObjectManager remembers both the object and its ID. Later during deserialization, GetObject can be used to discover whether a particular object ID has already been deserialized, or whether it is a forward reference to an object not yet deserialized.
ObjectManager Class | ObjectManager Members | System.Runtime.Serialization Namespace | ObjectManager.RegisterObject Overload List