ISerializationSurrogate.SetObjectData 方法

定义

使用 SerializationInfo中的信息填充对象。

public:
 System::Object ^ SetObjectData(System::Object ^ obj, System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context, System::Runtime::Serialization::ISurrogateSelector ^ selector);
public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector? selector);
public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector);
[System.Security.SecurityCritical]
public object SetObjectData (object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector);
abstract member SetObjectData : obj * System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISurrogateSelector -> obj
[<System.Security.SecurityCritical>]
abstract member SetObjectData : obj * System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISurrogateSelector -> obj
Public Function SetObjectData (obj As Object, info As SerializationInfo, context As StreamingContext, selector As ISurrogateSelector) As Object

参数

obj
Object

要填充的对象。

info
SerializationInfo

要填充对象的信息。

context
StreamingContext

从中反序列化对象的源。

selector
ISurrogateSelector

代理项选择器,其中搜索兼容的代理项开始。

返回

填充的反序列化对象。

属性

例外

调用方没有所需的权限。

注解

反序列化期间调用 SetObjectData 方法。 使用此方法,可以获取已创建的空 Objectobj,并将 SerializationInfoinfo 数据输入到该对象中。 构造函数在反序列化对象和重建对象期间不调用。

适用于