//Used in a child injector situation to configure a binder with a module at runtime internal void configureBinder(GuiceModule module) { if (module != null) { module.configure(binder); } }
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 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); }
//This is a little evil and I am not sure I like it, but it is the best way we can provide bindings to a child injector for now. public void configureInjector(ChildInjector injector, GuiceModule module) { injector.configureBinder( module ); }
//This is a little evil and I am not sure I like it, but it is the best way we can provide bindings to a child injector for now. public void configureInjector(ChildInjector injector, GuiceModule module) { injector.configureBinder(module); }