Dictionary<TKey,TValue>.GetObjectData(SerializationInfo, StreamingContext) Dictionary<TKey,TValue>.GetObjectData(SerializationInfo, StreamingContext) Dictionary<TKey,TValue>.GetObjectData(SerializationInfo, StreamingContext) Dictionary<TKey,TValue>.GetObjectData(SerializationInfo, StreamingContext) Method

定義

實作 ISerializable 介面,並傳回序列化 Dictionary<TKey,TValue> 執行個體所需的資料。Implements the ISerializable interface and returns the data needed to serialize the Dictionary<TKey,TValue> instance.

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
Public Overridable Sub GetObjectData (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

SerializationInfo 物件,包含序列化 Dictionary<TKey,TValue> 執行個體所需的資訊。A SerializationInfo object that contains the information required to serialize the Dictionary<TKey,TValue> instance.

context
StreamingContext StreamingContext StreamingContext StreamingContext

StreamingContext 結構,包含與 Dictionary<TKey,TValue> 執行個體關聯之序列化資料流的來源和目的端。A StreamingContext structure that contains the source and destination of the serialized stream associated with the Dictionary<TKey,TValue> instance.

實作

例外狀況

備註

這個方法是 O (n)運算,其中nCountThis method is an O(n) operation, where n is Count.

安全性

SecurityPermission
提供序列化服務。for providing serialization services. 相關聯的列舉: SerializationFormatter安全性動作:LinkDemandAssociated enumeration: SerializationFormatter Security action: LinkDemand

SecurityCriticalAttribute
需要完全信任立即呼叫者。requires full trust for the immediate caller. 部分信任或透明的程式碼無法使用這個成員。This member cannot be used by partially trusted or transparent code.

適用於

另請參閱