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

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Populates the object using the information in the SerializationInfo.

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

<SecurityCriticalAttribute>
Function SetObjectData (
	obj As Object,
	info As SerializationInfo,
	context As StreamingContext,
	selector As ISurrogateSelector
) As Object

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: