System.ComponentModel.Design.Serialization.IDesignerSerializationManager.SerializationComplete Event

Occurs when serialization is complete.

Syntax

public event EventHandler SerializationComplete

Remarks

This event is raised when serialization or deserialization is complete.

Generally, serialization code is written to emit serialization data and does not typically require state-related checking and processing. If it is necessary to maintain state data throughout serialization, data can be set and accessed by a serializer, which can listen to the IDesignerSerializationManager.SerializationComplete event, and clear the data after serialization. Restoring the proper state after serialization can be important because serializers can be reused during serialization, and leftover state data or open streams might not be correct.

For example, if a serializer needs to write to another file, such as a resource file, it is inefficient to design the serializer to close the file when finished. Serializing an object graph usually requires several serializers. The resource file would be opened and closed many times. Instead, the resource file can be closed at the end of serialization by an object that listened to the IDesignerSerializationManager.SerializationComplete event.

Requirements

Namespace: System.ComponentModel.Design.Serialization
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0