NameObjectCollectionBase.GetObjectData(SerializationInfo, StreamingContext) 方法

定义

实现 ISerializable 接口,并返回序列化 NameObjectCollectionBase 实例所需的数据。Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.

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);
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 对象,该对象包含序列化 NameObjectCollectionBase 实例所需的信息。A SerializationInfo object that contains the information required to serialize the NameObjectCollectionBase instance.

context
StreamingContext

StreamingContext 对象,该对象包含与 NameObjectCollectionBase 实例关联的序列化流的源和目标。A StreamingContext object that contains the source and destination of the serialized stream associated with the NameObjectCollectionBase instance.

实现

异常

infonullinfo is null.

注解

此方法是一个 O (n)操作,其中 nCount的。This method is an O(n) operation, where n is Count.

安全性

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

适用于

另请参阅