Пример #1
0
 public ObjectBlockReader(IObjectBlockParser parser, IObjectResolver resolver, IServiceLocator services, BlockRegistry blocks)
 {
     _parser   = parser;
     _resolver = resolver;
     _services = services;
     _blocks   = blocks;
 }
 public ObjectBlockWriter(ITypeDescriptorCache cache, IServiceLocator services, IBlockWriterLibrary writerLibrary, BlockRegistry blocks)
 {
     _cache         = cache;
     _services      = services;
     _writerLibrary = writerLibrary;
     _blocks        = blocks;
 }
Пример #3
0
        public static ObjectBlockReader Basic(Action <BlockRegistry> configure)
        {
            var registry = BlockRegistry.Basic();

            configure(registry);

            return(Basic(registry));
        }
        public static ObjectBlockWriter Basic(BlockRegistry registry)
        {
            var services = new InMemoryServiceLocator();

            services.Add <IDisplayFormatter>(new DisplayFormatter(services, new Stringifier()));

            return(new ObjectBlockWriter(new TypeDescriptorCache(), services, BlockWriterLibrary.Basic(), registry));
        }
Пример #5
0
 public static ObjectBlockReader Basic(BlockRegistry registry)
 {
     return(new ObjectBlockReader(new ObjectBlockParser(), ObjectResolver.Basic(), new InMemoryServiceLocator(), registry));
 }
Пример #6
0
 public static ObjectBlockReader Basic()
 {
     return(Basic(BlockRegistry.Basic()));
 }