public ISerializer Get(CollectionContentInput parameter)
 => new Serializer(_contents.Create(parameter.Classification,
                                    new ConditionalInnerContentHandler(_contents,
                                                                       new
                                                                       CollectionInnerContentHandler(parameter.Item,
                                                                                                     _contents))),
                   new EnumerableWriter(_enumerators, parameter.Item).Adapt());
Пример #2
0
        public ContentModel.ISerializer Get(TypeInfo parameter)
        {
            var entry  = _entries.Get(parameter);
            var reader = _contents.Create(parameter, new CollectionInnerContentHandler(entry, _contents));
            var result = new ContentModel.Serializer(reader, new EnumerableWriter(_enumerators, entry).Adapt());

            return(result);
        }
        public ISerializer Get(TypeInfo parameter)
        {
            var members = _serializations.Get(parameter);
            var reader  = _services.Create(parameter, new MemberInnerContentHandler(members, _services, _services));
            var result  = new Serializer(reader, new MemberListWriter(members));

            return(result);
        }
        public ISerializer Get(TypeInfo parameter)
        {
            var pair          = _locator.Get(parameter);
            var serializers   = new[] { Create(Key, pair.KeyType), Create(Value, pair.ValueType) };
            var serialization = _builder(serializers);

            var reader = _contents.Create(Type, new MemberInnerContentHandler(serialization, _contents, _contents));

            var converter = new Serializer(reader, new MemberListWriter(serialization));
            var result    = new Container <object>(_element, converter);

            return(result);
        }
        public ISerializer Get(TypeInfo parameter)
        {
            var members = _instances.Get(parameter);
            var entry   = _entries.Get(parameter);

            var handler = new CollectionWithMembersInnerContentHandler(new MemberInnerContentHandler(_instances.Get(parameter),
                                                                                                     _contents, _contents),
                                                                       new CollectionInnerContentHandler(entry, _contents));
            var reader = _contents.Create(parameter, handler);
            var writer =
                new MemberedCollectionWriter(new MemberListWriter(members), new EnumerableWriter(_enumerators, entry).Adapt());
            var result = new Serializer(reader, writer);

            return(result);
        }
        public ISerializer Get(CollectionContentInput parameter)
        {
            var members = _serializations.Get(parameter.Classification);
            var handler = new CollectionWithMembersInnerContentHandler(_contents,
                                                                       new MemberInnerContentHandler(members, _contents,
                                                                                                     _contents),
                                                                       new CollectionInnerContentHandler(parameter.Item,
                                                                                                         _contents));
            var reader = _contents.Create(parameter.Classification, handler);
            var writer =
                new MemberedCollectionWriter(new MemberListWriter(members),
                                             new EnumerableWriter(_enumerators, parameter.Item).Adapt());
            var result = new Serializer(reader, writer);

            return(result);
        }
Пример #7
0
        //public static ISerializer<T> Adapt<T>(this ISerializer @this) => new SerializerAdapter<T>(@this);

        /*		public static IWriter<T> Adapt<T>(this IWriter @this) => new WriterAdapter<T>(@this);
         *
         * public static IReader Adapt<T>(this IReader<T> @this) => new GenericReaderAdapter<T>(@this);
         * public static IReader<T> Adapt<T>(this IReader @this) => new ReaderAdapter<T>(@this);*/

        public static IReader <T> CreateContents <T>(this IInnerContentServices @this, IInnerContentHandler parameter)
        => new ReaderAdapter <T>(@this.Create(Support <T> .Key, parameter));