M
Michal Piatkowski
I have a problem with serialization of a polymorphic
array.
It has attributes defined XmlArray and XmlArrayItem for
XML serialization. The attribute specifies Type1 but as my
array is polymorphic I really want to have more than one
type inside of it. So I have objects of Type2, Type3, etc.
which inherit from Type1. They are in my array.
To be able to serialize the array, I would need to supply
all the types (Type2, Type3, etc...)
as XmlType attributes of my array during design time.
Otherwise I get Serializer exception. However, I load my
types dynamicly at runtime and I don't know what exact
types in my array will appear so I am not able to specify
them as attributes. As far as I know it is not
possible to change the value of an attribute at runtime.
What should I do to be able to serialize an array with
objects of types that are not known at design time ?
Can I modify value of an attribute or I should do
something else ?
Thanks
Michal Piatkowski
array.
It has attributes defined XmlArray and XmlArrayItem for
XML serialization. The attribute specifies Type1 but as my
array is polymorphic I really want to have more than one
type inside of it. So I have objects of Type2, Type3, etc.
which inherit from Type1. They are in my array.
To be able to serialize the array, I would need to supply
all the types (Type2, Type3, etc...)
as XmlType attributes of my array during design time.
Otherwise I get Serializer exception. However, I load my
types dynamicly at runtime and I don't know what exact
types in my array will appear so I am not able to specify
them as attributes. As far as I know it is not
possible to change the value of an attribute at runtime.
What should I do to be able to serialize an array with
objects of types that are not known at design time ?
Can I modify value of an attribute or I should do
something else ?
Thanks
Michal Piatkowski