Esempio n. 1
0
        private void SerializeCollection(IObjectBuilder builder, ICollection listType)
        {
            builder.BeginArray(listType.Count);

            foreach (var item in listType)
            {
                builder.BeginItem();
                SerializeInternal(builder, item, InnerLevel);
                builder.EndItem();
            }

            builder.EndArray();
        }
Esempio n. 2
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();
        }
Esempio n. 3
0
        private void ConvertArrayContent(IMessageReader reader, IObjectBuilder builder)
        {
            var itemCount = reader.ItemCount;
            builder.BeginArray(itemCount);

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

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

            builder.EndArray();
        }
Esempio n. 4
0
        private void ConvertArrayContent(IMessageReader reader, IObjectBuilder builder)
        {
            var itemCount = reader.ItemCount;

            builder.BeginArray(itemCount);

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

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

            builder.EndArray();
        }
Esempio n. 5
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();
        }
Esempio n. 6
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();
        }