public static TomlValue ValueFrom(Type type, object t) { var serializer = TomlSerializationMethods.GetSerializer(type) ?? TomlSerializationMethods.GetCompositeSerializer(type); var tomlValue = serializer.Invoke(t); return(tomlValue); }
public static void RegisterMapper <T>(TomlSerializationMethods.Serialize <T>?serializer, TomlSerializationMethods.Deserialize <T>?deserializer) => TomlSerializationMethods.Register(serializer, deserializer);
public static object To(Type what, TomlValue value) { var deserializer = TomlSerializationMethods.GetDeserializer(what) ?? TomlSerializationMethods.GetCompositeDeserializer(what); return(deserializer.Invoke(value)); }
public static T To <T>(TomlValue value) { var deserializer = TomlSerializationMethods.GetDeserializer <T>() ?? TomlSerializationMethods.GetCompositeDeserializer <T>(); return(deserializer.Invoke(value)); }