TypeConverter.cs 707 B

12345678910111213141516171819202122
  1. using System;
  2. namespace BepInEx.Configuration
  3. {
  4. /// <summary>
  5. /// A serializer/deserializer combo for some type(s). Used by the config system.
  6. /// </summary>
  7. public class TypeConverter
  8. {
  9. /// <summary>
  10. /// Used to serialize the type into a (hopefully) human-readable string.
  11. /// Object is the instance to serialize, Type is the object's type.
  12. /// </summary>
  13. public Func<object, Type, string> ConvertToString { get; set; }
  14. /// <summary>
  15. /// Used to deserialize the type from a string.
  16. /// String is the data to deserialize, Type is the object's type, should return instance to an object of Type.
  17. /// </summary>
  18. public Func<string, Type, object> ConvertToObject { get; set; }
  19. }
  20. }