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.

适用于

另请参阅