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;
        }
Beispiel #2
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);
        }
Beispiel #3
0
 public Binder(BindingHashMap hashMap)
 {
     this.hashMap = hashMap;
 }