Exemplo n.º 1
0
        public bool UpdateSerializersForInnerContainers(SerializationTypeInfo typeInfo, ref object obj)
        {
            if (!typeInfo.IsValid | !typeInfo.LatestSerializerWritesContainer)
            {
                return(false);
            }
            var serializer = _serializerInfos[typeInfo.SerializerIndex].Serializer as ISerializerWritesContainer;

            return(serializer.UpdateSerializersInInnerContainers(ref obj));
        }
Exemplo n.º 2
0
        public IDeserializer <TStream> GetDeserializer(SerializationTypeInfo typeInfo, int version)
        {
            int index         = typeInfo.DeserializerIndex;
            var typeId        = typeInfo.Id;
            var deserializers = _deserializerInfos;

            do
            {
                if (deserializers[index].Version == version)
                {
                    return(deserializers[index].Deserializer);
                }
                index++;
            } while (deserializers[index].TypeId == typeId);
            return(null);
        }
Exemplo n.º 3
0
        public ISerializer <TStream> GetSerializer(SerializationTypeInfo typeInfo, int version = -1)
        {
            // if version specified - search for the exact version match
            // else - take max version
            int index       = typeInfo.SerializerIndex;
            var typeId      = typeInfo.Id;
            var serializers = _serializerInfos;

            do
            {
                if (version == -1 || serializers[index].Version == version)
                {
                    return(serializers[index].Serializer);
                }
                index++;
            } while (serializers[index].TypeId == typeId);
            return(null);
        }