T
Tamir Khason
I have a base class MyBaseFoo with some properties, methods etc.
I have some derived classes, implements small part of MyBaseFoo and a lot of
their own.
In order to ensure proper deserialization on versioning MyBaseFoo implements
ISerializable and override constructor
So following
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
//info.AddValue("foo",foo);
//etc..
}
public MyBaseFoo(SerializationInfo info,StreamingContext context)
{
//foo = (Foo)info.GetValue("foo",typeof(foo));
}
The problem begins at derrived classes (with thier own variables)
The serialization made ONLY for base members, but not for derrived members.
Is any way to "discover" who inherit the class and get all properties to
serialize? Or I have to override both implementation and constructor
manually in derrived class. Is any intelligent way to implement such
pattern?
TNX
I have some derived classes, implements small part of MyBaseFoo and a lot of
their own.
In order to ensure proper deserialization on versioning MyBaseFoo implements
ISerializable and override constructor
So following
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
//info.AddValue("foo",foo);
//etc..
}
public MyBaseFoo(SerializationInfo info,StreamingContext context)
{
//foo = (Foo)info.GetValue("foo",typeof(foo));
}
The problem begins at derrived classes (with thier own variables)
The serialization made ONLY for base members, but not for derrived members.
Is any way to "discover" who inherit the class and get all properties to
serialize? Or I have to override both implementation and constructor
manually in derrived class. Is any intelligent way to implement such
pattern?
TNX