How can I run code in a C# class definition each time any instance of the class is deserialized?
- by Ben
I am trying to derive a class from ObservableCollection and I need to run just a single line of code each and every time any instance of this class is deserialized. My thought was to do this:
[Serializable]
public class ObservableCollection2<T> : ObservableCollection<T>, ISerializable
{
public ObservableCollection2()
:…