I have a quick question regarding the use of "default" as an enum value. I'm reading the contents of an existing XML file and parsing the element values to enums. Here is and example of what is in the XML file:
<userpref_load_policy>default</userpref_load_policy>
Unfortunately I cannot do the following as 'default' is a keyword! 'at_start' and 'in_background' are the other permitted values for this element.
public enum LoadPolicy { default, at_start, in_background }
Is there an "easy" way to use default as an enum value or trick the compliler? I have a nasty feeling I will need to resort to a custom extension method. I say this as I'm calling the .ToString() method when writing the XML file back out (and there are lots of enums..)
Thanks in advance for any pointers, Iain