ISerializationSurrogate.SetObjectData Method

Definition

Populates the object using the information in the SerializationInfo.

public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector? selector);
public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector);
[System.Security.SecurityCritical]
public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector);

Parameters

obj
Object

The object to populate.

info
SerializationInfo

The information to populate the object.

context
StreamingContext

The source from which the object is deserialized.

selector
ISurrogateSelector

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

Returns

The populated deserialized object.

Attributes

Exceptions

The caller does not have the required permission.

Remarks

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

Applies to