ISerializationSurrogate.GetObjectData(Object, SerializationInfo, StreamingContext) Method

Definition

Populates the provided SerializationInfo with the data needed to serialize the object.

public:
 void GetObjectData(System::Object ^ obj, System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Security.SecurityCritical]
public void GetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
abstract member GetObjectData : obj * System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
Public Sub GetObjectData (obj As Object, info As SerializationInfo, context As StreamingContext)

Parameters

obj
Object

The object to serialize.

info
SerializationInfo

The SerializationInfo to populate with data.

context
StreamingContext

The destination (see StreamingContext) for this serialization.

Attributes

Exceptions

The caller does not have the required permission.

Remarks

Extracts data from object obj and stores it in the SerializationInfoinfo parameter.

Having located the surrogate, this method stores information on the object obj in the SerializationInfoinfo parameter. This information describes its view of that object, including the object's fields, properties, and current values. The SerializationInfo might correspond to the actual object, or it can be a synthesized view of the surrogate.

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

Applies to