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

Definition

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)

Parameters

info
SerializationInfo

A SerializationInfo object that contains the information required to serialize the Dictionary<TKey,TValue> instance.

context
StreamingContext

A StreamingContext structure that contains the source and destination of the serialized stream associated with the Dictionary<TKey,TValue> instance.

Implements

Attributes

Exceptions

info is null.

Remarks

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

Security

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

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Applies to

See also