Dela via


PropertyCannotBeRetrievedException.GetObjectData Method

Populates a SerializationInfo object with the data needed to serialize the target object.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter := True)> _
Public Overrides Sub GetObjectData ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
'Usage
Dim instance As PropertyCannotBeRetrievedException
Dim info As SerializationInfo
Dim context As StreamingContext

instance.GetObjectData(info, context)
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context
)
[SecurityPermissionAttribute(SecurityAction::Demand, SerializationFormatter = true)]
public:
virtual void GetObjectData(
    SerializationInfo^ info, 
    StreamingContext context
) override
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
abstract GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
override GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
public override function GetObjectData(
    info : SerializationInfo, 
    context : StreamingContext
)

Implements

ISerializable.GetObjectData(SerializationInfo, StreamingContext)
_Exception.GetObjectData(SerializationInfo, StreamingContext)

Remarks

Any objects that are included in the SerializationInfo are automatically tracked and serialized by the formatter. Code that calls GetObjectData requires the SecurityPermission for providing serialization services. Associated enumeration: SerializationFormatter.

Note

It is not guaranteed that this method will be called only once per object instance during serialization. Therefore, the method should be implemented in such a way that its behavior will be the same regardless of the number of times it is called.