RealProxy.GetObjectData(SerializationInfo, StreamingContext) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將 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
序列化的來源和目的端。
- 屬性
例外狀況
info
或 context
參數為 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