serialization question

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I need to have one of my class to be serialized.
However some of its member should not be, but they they should be
initialized to correct values.

sort of

[Serializable]
class Document
{
int aField;
[NonSerialized]
List<Stuff> stuff;
}

however even though List stuff should not be serialized, it should be
initialized to new List<Stuff>
how do I do that?
I believe the constructor is not called during binar deserialization....
 
don't worry, found it in the documentation:
OnDeserializedAttribute
OnDeserializingAttribute
OnSerializedAttribute
OnSerializingAttribute
 
Back
Top