You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class "LImage" with a custom formatter, after register it with MemoryPackFormatterProvider.Register(new LImage.SerializationSurrogate());, it works fine.
But if there is another class contains "LImage" as property, then MemoryPack will not notice the custom formatter, I have to add attribute for this property:
public sealed class LImageFormatterAttribute : MemoryPackCustomFormatterAttribute<LImage>
{
public override IMemoryPackFormatter<LImage> GetFormatter()
{
return new LImage.SerializationSurrogate();
}
}
[MemoryPackable]
public partial class SomeImage
{
private LImage? image;
private List<LImage> list = new List<LImage>();
[LImageFormatter]
public LImage? Image { get => image; set => image = value; }
public List<LImage> List { get => list; set => list = value; }
}
Is it possible to register it globally then I don't need add attribute for every property?
The text was updated successfully, but these errors were encountered:
I have a class "LImage" with a custom formatter, after register it with
MemoryPackFormatterProvider.Register(new LImage.SerializationSurrogate());
, it works fine.But if there is another class contains "LImage" as property, then MemoryPack will not notice the custom formatter, I have to add attribute for this property:
Is it possible to register it globally then I don't need add attribute for every property?
The text was updated successfully, but these errors were encountered: