1

After solving the problem of Is it possible to recover an object serialized via "BinaryFormatter" after changing class names? I thought this would be also as simple, but spent about half an hour searching for an answer, and it seems it isn't...

Let's say I made a common mistake and declared this in a serializable class

public bool Foo {get;set;}

And now I want it to be

public bool Foo {get {return _foo;} set {_foo = value; OnFooChanged()}}
private bool _foo;

Because I need to do something when it's changed.

Can I somehow re-route data from "Foo" into "_foo" when Deserializing, in the same manner I can re-route classes with SerializationBinder?

Community
  • 1
  • 1
Istrebitel
  • 2,963
  • 6
  • 34
  • 49

0 Answers0