コード例 #1
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.PropNameCheck2 value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value is null)
            {
                writer.WriteNil();
                return;
            }

            var formatterResolver = options.Resolver;

            writer.WriteMapHeader(2);
            writer.WriteRaw(GetSpan_MyProperty1());
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.MyProperty1, options);
            writer.WriteRaw(GetSpan_MyProperty2());
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.MyProperty2, options);
        }
コード例 #2
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.C value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value is null)
            {
                writer.WriteNil();
                return;
            }

            var formatterResolver = options.Resolver;

            writer.WriteMapHeader(2);
            writer.WriteRaw(GetSpan_b());
            formatterResolver.GetFormatterWithVerify <global::TestData2.B>().Serialize(ref writer, value.b, options);
            writer.WriteRaw(GetSpan_a());
            writer.Write(value.a);
        }
コード例 #3
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest2 value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value is null)
            {
                writer.WriteNil();
                return;
            }

            var formatterResolver = options.Resolver;

            writer.WriteMapHeader(2);
            writer.WriteRaw(GetSpan_EnumId());
            formatterResolver.GetFormatterWithVerify <global::TestData2.Nest2.Id>().Serialize(ref writer, value.EnumId, options);
            writer.WriteRaw(GetSpan_ClassId());
            formatterResolver.GetFormatterWithVerify <global::TestData2.Nest2.IdType>().Serialize(ref writer, value.ClassId, options);
        }
コード例 #4
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.B value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value is null)
            {
                writer.WriteNil();
                return;
            }

            var formatterResolver = options.Resolver;

            writer.WriteMapHeader(3);
            writer.WriteRaw(GetSpan_ass());
            formatterResolver.GetFormatterWithVerify <global::System.Collections.Generic.List <global::TestData2.A> >().Serialize(ref writer, value.ass, options);
            writer.WriteRaw(GetSpan_c());
            formatterResolver.GetFormatterWithVerify <global::TestData2.C>().Serialize(ref writer, value.c, options);
            writer.WriteRaw(GetSpan_a());
            writer.Write(value.a);
        }
コード例 #5
0
        public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Record value, global::MessagePack.MessagePackSerializerOptions options)
        {
            if (value is null)
            {
                writer.WriteNil();
                return;
            }

            var formatterResolver = options.Resolver;

            writer.WriteMapHeader(1);
            writer.WriteRaw(GetSpan_SomeProperty());
            formatterResolver.GetFormatterWithVerify <string>().Serialize(ref writer, value.SomeProperty, options);
        }