Exemplo n.º 1
0
        public Injector createInjector(GuiceModule module)
        {
            var hashMap = new BindingHashMap();
            var binder = new Binder( hashMap );
            var loader = new SynchronousClassLoader(new XMLHttpRequest(), "generated/");
            var classResolver = new ClassResolver( loader );

            if (module != null) {
                module.configure(binder);
            }

            var injector = new Injector(binder, classResolver);
            binder.bind(typeof(Injector)).toInstance(injector);
            binder.bind(typeof(ClassResolver)).toInstance(classResolver);
            binder.bind(typeof(SynchronousClassLoader)).toInstance(loader);

            return injector;
        }
 public ClassResolver( SynchronousClassLoader loader )
 {
     this.loader = loader;
 }