CHUNITHM-Patch-Finder/Converters/HexNumberJsonConverter.cs
2024-04-11 15:44:23 +07:00

18 lines
537 B
C#

using Newtonsoft.Json;
namespace CHUNITHM_Patch_Finder.Converters;
public class HexNumberJsonConverter : JsonConverter<int>
{
public override bool CanRead => false;
public override void WriteJson(JsonWriter writer, int value, JsonSerializer serializer)
{
writer.WriteRawValue($"0x{value:X2}");
}
public override int ReadJson(JsonReader reader, Type objectType, int existingValue, bool hasExistingValue, JsonSerializer serializer)
{
throw new NotImplementedException();
}
}