DesignerSerializationManager.IDesignerSerializationManager.SerializationComplete 事件

定義

於序列化完成時發生。

event EventHandler System.ComponentModel.Design.Serialization.IDesignerSerializationManager.SerializationComplete;
member this.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.SerializationComplete : EventHandler 
Custom Event SerializationComplete As EventHandler Implements System.ComponentModel.Design.Serialization.IDesignerSerializationManager

事件類型

實作

例外狀況

序列化管理員沒有使用中的序列化工作階段。

備註

串行化程式通常是單個線程,而且應該是無狀態。 當這些特性不成立時, SerializationComplete 事件可用來協助組織程式。 串行化程式可以追蹤此事件,以瞭解串行化程式已完成。

例如,有時候串行化程式需要寫入另一個檔案,例如資源檔。 在這種情況下,設計串行化程式在完成檔案時關閉檔案會效率不佳,因為物件圖形的串行化通常需要數個串行化程式;因此,資源文件會開啟並關閉多次。 相反地,資源檔可以透過追蹤 SerializationComplete 事件的物件來存取,而且該物件可以在串行化結束時關閉資源檔。

在相關的用法中,此事件可用來移除串行化管理員中安裝的暫存服務。

適用於

另請參閱