ISerializationSurrogate.GetObjectData Method (Object, SerializationInfo, StreamingContext)

 

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

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

[SecurityCriticalAttribute]
void GetObjectData(
	object obj,
	SerializationInfo info,
	StreamingContext context
)

Parameters

obj
Type: System.Object

The object to serialize.

info
Type: System.Runtime.Serialization.SerializationInfo

The SerializationInfo to populate with data.

context
Type: System.Runtime.Serialization.StreamingContext

The destination (see StreamingContext) for this serialization.

Exception Condition
SecurityException

The caller does not have the required permission.

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.

.NET Framework
Available since 1.1
Return to top
Show: