Implements non-generic or common portion of abstract collection serializers.
Esempio n. 1
0
        public AbstractReadOnlyCollectionMessagePackSerializer(
            SerializationContext ownerContext,
            Type targetType,
            PolymorphismSchema schema
            )
            : base(ownerContext, schema)
        {
            MessagePackSerializer serializer;

            AbstractCollectionSerializerHelper.GetConcreteSerializer(
                ownerContext,
                schema,
                typeof(TCollection),
                targetType,
                typeof(EnumerableMessagePackSerializerBase <,>),
                out this._concreteCollectionInstanceFactory,
                out serializer
                );
            this._polymorphicDeserializer = serializer as IPolymorphicDeserializer;
            this._concreteDeserializer    = serializer;
        }
        public AbstractReadOnlyDictionaryMessagePackSerializer(
            SerializationContext ownerContext,
            Type targetType,
            PolymorphismSchema schema
            )
            : base(ownerContext, schema)
        {
            IMessagePackSingleObjectSerializer serializer;

            AbstractCollectionSerializerHelper.GetConcreteSerializer(
                ownerContext,
                schema,
                typeof(TDictionary),
                targetType,
                typeof(DictionaryMessagePackSerializer <, ,>),
                out this._concreteCollectionInstanceFactory,
                out serializer
                );
            this._polymorphicDeserializer = serializer as IPolymorphicDeserializer;
            this._concreteDeserializer    = serializer;
        }