HashSet<T>::GetObjectData Method (SerializationInfo^, StreamingContext)

 

Implements the System.Runtime.Serialization::ISerializable interface and returns the data needed to serialize a HashSet<T> object.

Namespace:   System.Collections.Generic
Assembly:  System.Core (in System.Core.dll)

public:
[SecurityCriticalAttribute]
[SecurityPermissionAttribute(SecurityAction::LinkDemand, Flags = SecurityPermissionFlag::SerializationFormatter)]
virtual void GetObjectData(
	SerializationInfo^ info,
	StreamingContext context
)

Parameters

info
Type: System.Runtime.Serialization::SerializationInfo^

A System.Runtime.Serialization::SerializationInfo object that contains the information required to serialize the HashSet<T> object.

context
Type: System.Runtime.Serialization::StreamingContext

A System.Runtime.Serialization::StreamingContext structure that contains the source and destination of the serialized stream associated with the HashSet<T> object.

Exception Condition
ArgumentNullException

info is null.

Calling this method is an O(n) operation, where n is Count.

SecurityPermission

for providing serialization services. Security action: LinkDemand. Associated enumeration: SecurityPermissionFlag::SerializationFormatter

.NET Framework
Available since 3.5
Return to top
Show: