C
Chris Dunaway
Suppose I have the following enum:
public enum MyEnum {
EnumVal1 = 1,
EnumVal2 = 2,
EnumVal3 = 3
}
I want to serialize the enum but I want the /names/ of the enum to be
stored in the .xml file, like this:
MyEnum e;
e = MyEnum.EnumVal2;
// Serialization code here
I want the resulting element or attribute to be like this:
<myenum>EnumVal2</myenum>
Can this be done? Can you control how an enum is serialized?
Thanks,
public enum MyEnum {
EnumVal1 = 1,
EnumVal2 = 2,
EnumVal3 = 3
}
I want to serialize the enum but I want the /names/ of the enum to be
stored in the .xml file, like this:
MyEnum e;
e = MyEnum.EnumVal2;
// Serialization code here
I want the resulting element or attribute to be like this:
<myenum>EnumVal2</myenum>
Can this be done? Can you control how an enum is serialized?
Thanks,