ISerializationSurrogate.SetObjectData Method (Object, SerializationInfo, StreamingContext, ISurrogateSelector)

 

Populates the object using the information in the SerializationInfo.

Namespace:   System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
object SetObjectData(
	object obj,
	SerializationInfo info,
	StreamingContext context,
	ISurrogateSelector selector
)

Parameters

obj
Type: System.Object

The object to populate.

info
Type: System.Runtime.Serialization.SerializationInfo

The information to populate the object.

context
Type: System.Runtime.Serialization.StreamingContext

The source from which the object is deserialized.

selector
Type: System.Runtime.Serialization.ISurrogateSelector

The surrogate selector where the search for a compatible surrogate begins.

Return Value

Type: System.Object

The populated deserialized object.

Exception Condition
SecurityException

The caller does not have the required permission.

The SetObjectData method is called during deserialization. With this method, you can take the empty Objectobj that has already been created, and enter SerializationInfoinfo data into that object. Constructors are not invoked during deserialization of information and reconstruction of the object.

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

.NET Framework
Available since 1.1
Return to top
Show: