public object ConvertFromXml(string text) { if (Type == null) { return(null); } object value; if (Type == typeof(string)) { value = text; } else if (Type == typeof(bool)) { value = text.ToBool(); } else if (Type == typeof(int)) { value = text.ToInt(); } else if (Type == typeof(Color)) { value = GUIPlus.HexToColor(text); } else { return(null); } return(value); }