Serialize Color to XML

L

lux

I have :

enum MyEnum{d1, d2};
class MyData
{
public Color color{}..//get, set
public MyEnum enum{}..// get,set
}

I'm serializing MyData object to xml using XmlSerializer.
MyData pc = new MyData();

XmlSerializer xs = new XmlSerializer(typeof(MyData));

TextWriter writer = new StreamWriter("c:\\pra.xml");

xs.Serialize(writer, pc);

It works but color is not serialized. Why? Color is enum like my MyEnum.
 
M

Marc Gravell

Cor's advise re ARGB is correct.

For the record, color is not an enum; the simple/system colors are
static properties, not enum values.

(still missing the "u" though... ;-p)

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top