ZeroFormatter icon indicating copy to clipboard operation
ZeroFormatter copied to clipboard

Ignore formats removes next node

Open janovrom opened this issue 5 years ago • 0 comments

Imagine this code:

public class BufferView
    {
        [ZeroFormatter.IgnoreFormat] public int Width { get => TriangleCount; set => TriangleCount = value; }
        [ZeroFormatter.IgnoreFormat] public int Height { get => VertexCount; set => VertexCount = value; }
        [ZeroFormatter.Index(0)] public virtual byte Padding { get; set; } // IgnoreFormat for some reason removes the first index
        [ZeroFormatter.Index(1)] public virtual long Start { get; set; }
        [ZeroFormatter.Index(2)] public virtual long ByteLength { get; set; }
        [ZeroFormatter.Index(3)] public virtual int TriangleCount { get; set; }
        [ZeroFormatter.Index(4)] public virtual int VertexCount { get; set; }
    }

This will result in Padding not being serialized - when searching for this property in the ZFC-generated file, it's no there. If the properties with IgnoreFormatAttribute are moved to the end, even the whole next ZeroFormattable class is removed.

janovrom avatar Apr 17 '20 13:04 janovrom