我正在尝试编写一个应该将类序列化为XML文件的程序,但最近我的规范发生了变化,现在我有一个以前唯一且非空字段改变如下:
如何更改课程以允许此类行为?
实际值:
<Serializable>
Public Class DataType
Public FieldToChange As New FieldType 'FieldType to change
End Class
<Serializable>
Public class FieldType
Public a As Integer
Public b As Integer
Public c As Integer
End Class
未来:
<Serializable>
Public Class ClassWithElemToChangeType
<XmlElement("FieldType")> ' Is it right?
Public FieldToChange As New List(Of FieldType)
End Class
<Serializable>
Public class FieldType
Public a As Integer
Public b As Integer
Public c As Integer
Public id As Integer
' How can i add a field that gets ignored whenever is null
' or how can I programmatically tell my serializer to ignore
End Class