T
Tom
I am having trouble serializing a color property. Basically, it is not
serializing the value. For instance, in the following:
<Serializable()> _
Public Class TestColor
Private _MyColor As System.Drawing.Color = System.Drawing.Color.Red
Public Property MyColor() As System.Drawing.Color
Get
Return _MyColor
End Get
Set(ByVal Value as System.Drawing.Color)
_Orange = Value
End Set
End Property
End Class
If I instantiate this class, set the MyColor property to
System.Drawing.Color.Purple and then serialize it to an XML file, I get
something like the following line in the file:
<MyColor />
which is obviously not correct. And when deserialized MyColor of course gets
set to nothing/White/0.
I know that I saw somewhere that there was -something- extra I had to do to
serialize/deserialize this type of data (i.e. Color data) properly. But I
can't remember what it was and can't seem to find it anymore. Anyone got the
solution? Driving me crazy....
Tom
rather than the actual
serializing the value. For instance, in the following:
<Serializable()> _
Public Class TestColor
Private _MyColor As System.Drawing.Color = System.Drawing.Color.Red
Public Property MyColor() As System.Drawing.Color
Get
Return _MyColor
End Get
Set(ByVal Value as System.Drawing.Color)
_Orange = Value
End Set
End Property
End Class
If I instantiate this class, set the MyColor property to
System.Drawing.Color.Purple and then serialize it to an XML file, I get
something like the following line in the file:
<MyColor />
which is obviously not correct. And when deserialized MyColor of course gets
set to nothing/White/0.
I know that I saw somewhere that there was -something- extra I had to do to
serialize/deserialize this type of data (i.e. Color data) properly. But I
can't remember what it was and can't seem to find it anymore. Anyone got the
solution? Driving me crazy....
Tom
rather than the actual