I have a class A that provides an event. an object of class B subscribed to an event. Both instances actually also contain a regular link to eachother. I would like to serialize A and pass both objects through the wiring to be reconstructed at the other end. This works great except that event subscriptions are not saved.
I think I need to implement my own serialization constructor in order to βbe notifiedβ when my objects are deserialized, so it can re-subscribe to the event.
However, it looks like this means that I have to fully implement seialization myself, implementing ISerializable. Now I rely on the attributes of BinaryFormatter and [Serializable], and actually so much.
Does anyone know how to get a deserialization notification while still being able to use the built-in serialization system to automatically serialize and deserialize my somewhat complex graph of objects for me?
Thanks Lucas
c # events serialization
Lucas
source share