L
Lance
Is there a way to prevent events from being serialized?
For example, I have a serializable class with a Public
property called "Name". The property returns a Protected
string called "_Name". Also, the class has an event
called "NameChanged" that is fired (via the OnNameChanged
method) whenever "_Name" changes.
Ok, enough of that name calling. When I serialize the
class using XML I get a line like the following:
<NameChangedEvent xsi:null="1" />
Is there a way to prevent this line from appearing? I
tried putting <System.NonSerialized()> before NameChanged
but this causes a compile error. Also, is there a reason
why I would want that line to appear?
Thank you,
Lance
For example, I have a serializable class with a Public
property called "Name". The property returns a Protected
string called "_Name". Also, the class has an event
called "NameChanged" that is fired (via the OnNameChanged
method) whenever "_Name" changes.
Ok, enough of that name calling. When I serialize the
class using XML I get a line like the following:
<NameChangedEvent xsi:null="1" />
Is there a way to prevent this line from appearing? I
tried putting <System.NonSerialized()> before NameChanged
but this causes a compile error. Also, is there a reason
why I would want that line to appear?
Thank you,
Lance