System.Runtime.Serialization.ISerializationSurrogate.SetObjectData Method

Populates the object using the information in the System.Runtime.Serialization.SerializationInfo.

Syntax

public object SetObjectData (object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)

Parameters

obj
The object to populate.
info
The information to populate the object.
context
The source from which the object is deserialized.
selector
The surrogate selector where the search for a compatible surrogate begins.

Returns

The populated deserialized object.

Remarks

The ISerializationSurrogate.SetObjectData(object, SerializationInfo, StreamingContext, ISurrogateSelector) method is called during deserialization. With this method, you can take the empty object obj that has already been created, and enter System.Runtime.Serialization.SerializationInfo info data into that object. Constructors are not invoked during deserialization of information and reconstruction of the object.

This method is protected by a System.Security.Permissions.SecurityAction.LinkDemand for the System.Security.Permissions.SecurityPermission with the System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter specified.

Requirements

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