P
pamela fluente
I have a class marked serialized. This class has some *thousands*
fields and properties.
Among them there is, in particular, 1 object. Let's call it MyObject.
What I need is being able, at my will, to perform either one of the
following actions:
- Serialize the class including MyObject
- Serialize the class EXCLUDING MyObject (that is, like if
MyObject would not be serializable)
1. I have already looked into ISerializable - of course - but at
first sight seemed impractical to use
because I have thousands properties and fields and clearly I cannot
write a ISerializable.GetObjectData
for all of them. Also it would not be easily maintainable.
2. I do not wish to wrap the other properties and fields in another
class, because that would be awkward.
How can I do that?
Thank you very much for any help.
-P
fields and properties.
Among them there is, in particular, 1 object. Let's call it MyObject.
What I need is being able, at my will, to perform either one of the
following actions:
- Serialize the class including MyObject
- Serialize the class EXCLUDING MyObject (that is, like if
MyObject would not be serializable)
1. I have already looked into ISerializable - of course - but at
first sight seemed impractical to use
because I have thousands properties and fields and clearly I cannot
write a ISerializable.GetObjectData
for all of them. Also it would not be easily maintainable.
2. I do not wish to wrap the other properties and fields in another
class, because that would be awkward.
How can I do that?
Thank you very much for any help.
-P