ISerializationSurrogate.GetObjectData Method
Populates the provided SerializationInfo with the data needed to serialize the object.
[Visual Basic] Sub GetObjectData( _ ByVal obj As Object, _ ByVal info As SerializationInfo, _ ByVal context As StreamingContext _ ) [C#] void GetObjectData( object obj, SerializationInfo info, StreamingContext context ); [C++] void GetObjectData( Object* obj, SerializationInfo* info, StreamingContext context ); [JScript] function GetObjectData( obj : Object, info : SerializationInfo, context : StreamingContext );
Parameters
- obj
- The object to serialize.
- info
- The SerializationInfo to populate with data.
- context
- The destination (see StreamingContext) for this serialization.
Exceptions
| Exception Type | Condition |
|---|---|
| SecurityException | The caller does not have the required permission. |
Remarks
Extracts data from object obj and stores it in the SerializationInfo info.
Having located the surrogate, this method stores information on the object obj in the SerializationInfo info that describes its view of that object. This view includes 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.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
ISerializationSurrogate Interface | ISerializationSurrogate Members | System.Runtime.Serialization Namespace