H
Helmut Giese
Hello out there,
I have a class which is almost serializable - it contains one element
which isn't. Currently I have this:
[Serializable]
class MetaControl {
[XmlIgnore]
Control ctrl; // this is the problem child
int foo;
<lots more variables>
}
Oh, and I have a 2 dimensional array of these:
MetaControl[,] metaControl;
What would be a way to get this array serialized/deserialized?
Idea: Is there a way to perform serialisation "piecemeal"?
- Start: Let the serialiser write the XML header
- Intro: Serialize numRows & numColumns
- Loop: Feed it
-- one MetaControl followed by
-- a custom serialisation of its Control's properties
- End: Let the serialiser terminate the XML
I am asking, because all examples which I found just call
serializer.Serialize(outputStream, <...>)
where '<...>' is the total to be sent out - be it one object, a list
or some other kind of container.
At the worst I could of course create a DOM tree and write it from
there but hopefully there is a nicer solution.
Any idea on how to solve this will be greatly appreciated.
Best regards
Helmut Giese
I have a class which is almost serializable - it contains one element
which isn't. Currently I have this:
[Serializable]
class MetaControl {
[XmlIgnore]
Control ctrl; // this is the problem child
int foo;
<lots more variables>
}
Oh, and I have a 2 dimensional array of these:
MetaControl[,] metaControl;
What would be a way to get this array serialized/deserialized?
Idea: Is there a way to perform serialisation "piecemeal"?
- Start: Let the serialiser write the XML header
- Intro: Serialize numRows & numColumns
- Loop: Feed it
-- one MetaControl followed by
-- a custom serialisation of its Control's properties
- End: Let the serialiser terminate the XML
I am asking, because all examples which I found just call
serializer.Serialize(outputStream, <...>)
where '<...>' is the total to be sent out - be it one object, a list
or some other kind of container.
At the worst I could of course create a DOM tree and write it from
there but hopefully there is a nicer solution.
Any idea on how to solve this will be greatly appreciated.
Best regards
Helmut Giese