private void WritePrimitiveContent(XmlWriter writer, TypeMapping mapping, object obj) { if (obj != null) { Type type = obj.GetType(); string text = null; if (type == typeof(string)) { text = (string)obj; if (text == "") { return; } } else { text = ((type != typeof(bool)) ? ((type != typeof(DateTime)) ? obj.ToString() : XmlCustomFormatter.FromDateTime((DateTime)obj)) : (((bool)obj) ? "true" : "false")); } writer.WriteString(text); } }
public static DateTime ToTime(string value) { return(XmlCustomFormatter.ToDateTime(value, XmlCustomFormatter.allTimeFormats)); }