Serializing System.Drawing.Color in .NET

后端 未结 2 1322
名媛妹妹
名媛妹妹 2021-01-21 03:08

I\'ve used the default .NET serialization for a class with a System.Drawing.Color member. The code is now in use by people, and I need to add an extra member to the class, but

2条回答
  •  迷失自我
    2021-01-21 03:18

    I have used something like this in the past.

      Public BackColour As Drawing.Color
    
            Public Property xmlBackColour() As Integer
                Get
                    Return BackColour.ToArgb
                End Get
                Set(ByVal value As Integer)
                    BackColour = Drawing.Color.FromArgb(value)
                End Set
            End Property
    

提交回复
热议问题