G
Guest
I have two classes that are XML Serializable, lets just call them Class A &
B. I would like to expose Class B as a property of Class A and have both
classes simply serialize with Class B as an element (and then serialize
itself as it normally would). How can I accomplish this? (More specifically,
what's the attributes for the property to serialize correctly.) Basically I
want the following XML:
<ClassA><MySubClass><MySubClassNode/></MySubClass></ClassA>
Code Example:
<XmlRoot()>_
Public Class ClassA
Private _subClassB As ClassB
<??????????????????>_
Public Property MySubClass As ClassB
Get
Return _classB
Set ETC...
End Property
End Class
<XmlRoot()>_
Public Class B
Private _var As String=""
<XmlElement("MySubClassNode")>_
Public Property MySubClassNode As String
Get
Return _var
ETC...
End Property
End Class
B. I would like to expose Class B as a property of Class A and have both
classes simply serialize with Class B as an element (and then serialize
itself as it normally would). How can I accomplish this? (More specifically,
what's the attributes for the property to serialize correctly.) Basically I
want the following XML:
<ClassA><MySubClass><MySubClassNode/></MySubClass></ClassA>
Code Example:
<XmlRoot()>_
Public Class ClassA
Private _subClassB As ClassB
<??????????????????>_
Public Property MySubClass As ClassB
Get
Return _classB
Set ETC...
End Property
End Class
<XmlRoot()>_
Public Class B
Private _var As String=""
<XmlElement("MySubClassNode")>_
Public Property MySubClassNode As String
Get
Return _var
ETC...
End Property
End Class