c# Programming Glossary: ondeserializing
DataContractSerializer doesn't call my constructor? http://stackoverflow.com/questions/1076730/datacontractserializer-doesnt-call-my-constructor constructor being called NOTE I know that I can use the OnDeserializing attribute to initialize my object when deserialization begins..
How to use Custom Serialization or Deserialization in WCF to force a new instance on every property of a datacontact ? http://stackoverflow.com/questions/8084868/how-to-use-custom-serialization-or-deserialization-in-wcf-to-force-a-new-instanc MyCustonObj.MyStrData Overridden in serialization OnDeserializing void OnDeserializing StreamingContext c if MyCustonObj null.. Overridden in serialization OnDeserializing void OnDeserializing StreamingContext c if MyCustonObj null MyCustonObj new MyCustomClass..
Field Initializer in C# Class not Run when Deserializing http://stackoverflow.com/questions/9419743/field-initializer-in-c-sharp-class-not-run-when-deserializing is used instead. To resolve it you can make use of the OnDeserializing or OnDerserialized attributes to have the deserializer call.. call a function with the following signature void OnDeserializing System.Runtime.Serialization.StreamingContext c In that function.. private void OnCreated myDict new Dictionary int string OnDeserializing private void OnDeserializing StreamingContext c OnCreated private..
|