我正在尝试序列化和反序列化 LiteDb 中的 System.Drawing.Color 属性。我已经阅读了下面的文章,但不知道如何在代码中实现它:
这是 poco 类的示例:
Public Class mPage
<Id(1, 1), Category("IDs"), [ReadOnly](True)>
Public Property ID As ObjectId = ObjectId.NewObjectId
<Id(1, 10), Category("General"), DisplayName("Design Name"), Description("Name used in the designer (short - just for identification purposes).")>
<TypeConverter(GetType(RemoveSpaces))>
Public Property Name As String = ""
<Id(15, 10), Category("General"), DisplayName("Background Color"), Description("The background color of the page.")>
Public Property BackgroundColor As Color = Color.LightGray
End Class
LiteDb 本身并不处理颜色(请参见此处)。我如何实现这一目标?