RealProxy.GetObjectData(SerializationInfo, StreamingContext) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 RealProxy 的当前实例所表示的对象的透明代理添加到指定的 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
将该透明代理序列化到其中的 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