One problem bugged me enough to register on stackoverflow. Currently if I want to serialize Color to XML string as named color, or #rrggbb, or #aarrggbb, i do it like this:
[XmlIgnore()]
public Color color;
[XmlElement(ElementName = "Color")]
public String color_XmlSurrogate
{
get { return MyColorConverter.SetColor(color); }
set { MyColorConverter.GetColor(value); }
}
Here MyColorConverter does serialization just the way I like it. But all this feels like a kludge, with additional field and all. Is there a way to make it work in less lines, maybe connecting TypeDescriptor with C# attributes related to xml?