CHUNITHM-Patch-Finder/Converters/HexNumberJsonConverter.cs

18 lines
537 B
C#
Raw Normal View History

2024-04-11 10:44:23 +02:00
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();
}
}