Exemplo n.º 1
0
        private void SerializeStruct <T>(IObjectBuilder builder, IDictionary <string, T> structType)
        {
            builder.BeginStruct(structType.Count);

            foreach (var kvp in structType)
            {
                builder.BeginItem();
                builder.WritePropertyName(kvp.Key);

                SerializeInternal(builder, kvp.Value, InnerLevel);

                builder.EndItem();
            }
            builder.EndStruct();
        }
Exemplo n.º 2
0
        private void ConvertStructContent(IMessageReader reader, IObjectBuilder builder)
        {
            var elementCount = reader.ItemCount;

            builder.BeginStruct(reader.ItemCount);

            for (; elementCount > 0; elementCount--)
            {
                builder.BeginItem();
                reader.Read();

                builder.WritePropertyName(reader.PropertyName);

                ConvertValue(reader, builder);
                builder.EndItem();
            }

            builder.EndStruct();
        }
Exemplo n.º 3
0
        private void ConvertStructContent(IMessageReader reader, IObjectBuilder builder)
        {
            var elementCount = reader.ItemCount;
            builder.BeginStruct(reader.ItemCount);

            for (; elementCount > 0; elementCount--)
            {
                builder.BeginItem();
                reader.Read();

                builder.WritePropertyName(reader.PropertyName);

                ConvertValue(reader, builder);
                builder.EndItem();
            }

            builder.EndStruct();
        }