public static void LoadFromElement(XmlElement e, Value.EnumBase value, bool isClip) { var text = e.GetText(); var parsed = 0; if (int.TryParse(text, out parsed)) { value.SetValue(parsed); } }
public static XmlElement SaveToElement(XmlDocument doc, string element_name, Value.EnumBase value, bool isClip) { if (value.GetValueAsInt() == value.GetDefaultValueAsInt()) { return(null); } var text = value.GetValueAsInt().ToString(); return(doc.CreateTextElement(element_name, text)); }