共用方式為


RealProxy.GetObjectData(SerializationInfo, StreamingContext) 方法

定義

RealProxy 的目前執行個體所代表物件的透明 Proxy 加入至 SerializationInfo

public:
 virtual void GetObjectData(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
public virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Security.SecurityCritical]
public virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
abstract member GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
[<System.Security.SecurityCritical>]
abstract member GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> unit
Public Overridable Sub GetObjectData (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo

序列化透明 Proxy 所至的 SerializationInfo

context
StreamingContext

序列化的來源和目的端。

屬性

例外狀況

infocontext 參數為 null

立即呼叫端沒有 SerializationFormatter 使用權限。

範例

[System::Security::Permissions::SecurityPermissionAttribute(
System::Security::Permissions::SecurityAction::LinkDemand,
Flags=System::Security::Permissions::SecurityPermissionFlag::Infrastructure)]
virtual void GetObjectData( SerializationInfo^ info, StreamingContext context ) override
{
   // Add your custom data if any here.
   RealProxy::GetObjectData( info, context );
}
public override void GetObjectData( SerializationInfo info,
                                    StreamingContext context)
{
   // Add your custom data if any here.
   base.GetObjectData(info, context);
}
Public Overrides Sub GetObjectData(info As SerializationInfo, context As StreamingContext)
   ' Add your custom data if any here.
   MyBase.GetObjectData(info, context)
End Sub

適用於