G
Guest
In the current project that I am planning i am thinking of serializing the
objects to save as binary files. The question I have is with inheriting
classes.
If I have 1 base class and 2 classes that inherit from it. How would I
configure them for serialization. Do I just put the Serialized setting on the
2 classes or do I also have to put it on the base class.
ie.
class IBaseClass
{
....
}
[Serializable]
class FirstClass : IBaseClass
{
....
}
[Serializable]
class SecondClass : IBaseClass
{
....
}
or.
[Serializable]
class IBaseClass
{
....
}
[Serializable]
class FirstClass : IBaseClass
{
....
}
[Serializable]
class SecondClass : IBaseClass
{
....
}
objects to save as binary files. The question I have is with inheriting
classes.
If I have 1 base class and 2 classes that inherit from it. How would I
configure them for serialization. Do I just put the Serialized setting on the
2 classes or do I also have to put it on the base class.
ie.
class IBaseClass
{
....
}
[Serializable]
class FirstClass : IBaseClass
{
....
}
[Serializable]
class SecondClass : IBaseClass
{
....
}
or.
[Serializable]
class IBaseClass
{
....
}
[Serializable]
class FirstClass : IBaseClass
{
....
}
[Serializable]
class SecondClass : IBaseClass
{
....
}