private static string GetString(object value) { Type type = value.GetType(); if (type.IsEnum) { KmlElementAttribute att = TypeBrowser.GetEnum((Enum)value); if (att != null) { return(att.ElementName); } } return(string.Format(KmlFormatter.Instance, "{0}", value)); }
private string GetString(object value) { TypeInfo typeInfo = value.GetType().GetTypeInfo(); if (typeInfo.IsEnum) { KmlElementAttribute att = TypeBrowser.GetEnum((Enum)value); if (att != null) { return(att.ElementName); } } if (((this.Options & SerializerOptions.ReadableFloatingPoints) != 0) && (value is double || value is float)) { return(string.Format(KmlFormatter.Instance, "{0:G}", value)); } else { return(string.Format(KmlFormatter.Instance, "{0}", value)); } }