共用方式為


WeakReference.GetObjectData(SerializationInfo, StreamingContext) 方法

定義

警告

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

使用序列化目前 SerializationInfo 物件所需的所有資料,來填入 WeakReference 物件。

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.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
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.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
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

保有序列化或還原序列化目前 WeakReference 物件所需之所有資料的物件。

context
StreamingContext

(保留) 位置,序列化資料在此儲存和擷取。

實作

屬性

例外狀況

infonull

備註

這個方法會將序列化目前 WeakReference 物件所需的所有資訊 info 儲存在內。

參數 context 是保留的,目前不會用於此方法的執行中。

適用於

另請參閱