HashSet<T>.GetObjectData(SerializationInfo, StreamingContext) 方法

定义

实现 ISerializable 接口并返回序列化 HashSet<T> 对象所需的数据。Implements the ISerializable interface and returns the data needed to serialize a HashSet<T> object.

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 对象,其中包含序列化 HashSet<T> 对象所需的信息。A SerializationInfo object that contains the information required to serialize the HashSet<T> object.

context
StreamingContext

StreamingContext 结构,其中包含与 HashSet<T> 对象关联的序列化流的源和目标。A StreamingContext structure that contains the source and destination of the serialized stream associated with the HashSet<T> object.

实现

属性

异常

infonullinfo is null.

注解

调用此方法的运算复杂度为 O (n),其中 n CountCalling this method is an O(n) operation, where n is Count.

安全性

SecurityPermission
用于提供序列化服务。for providing serialization services. 安全操作: LinkDemandSecurity action: LinkDemand. 关联的枚举: SerializationFormatterAssociated enumeration: SerializationFormatter

适用于