共用方式為


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 數據輸入該物件。 建構函式不會在還原串行化物件的資訊和重建期間叫用。

適用於