Posted 20 years ago
by byperman
- Sint-Niklaas, Belgium

Hi,
I've got a class (Script) that inherits from Document, that adds some functionality and holds a few extra properties (version, modification, things like that). I used to hold all of this in a separate class, and kept Document and Script synchronized; this, however, was slow and hard to maintain.
Now that I inherit from Document, I am no longer able to serialize my properties because XmlSerializer tries to serialize all kinds of properties from Document. Unfortunately there seems to be no way to prevent the XmlSerializer from doing this, except putting the XmlIgnoreAttribute before every property in the base class, and then control the serialization by overriding the properties you'd like to see serialized.
Any thoughts on this issue?
Thanks a lot,
Brecht
I've got a class (Script) that inherits from Document, that adds some functionality and holds a few extra properties (version, modification, things like that). I used to hold all of this in a separate class, and kept Document and Script synchronized; this, however, was slow and hard to maintain.
Now that I inherit from Document, I am no longer able to serialize my properties because XmlSerializer tries to serialize all kinds of properties from Document. Unfortunately there seems to be no way to prevent the XmlSerializer from doing this, except putting the XmlIgnoreAttribute before every property in the base class, and then control the serialization by overriding the properties you'd like to see serialized.
Any thoughts on this issue?
Thanks a lot,
Brecht