private void RegisterWebServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration) { pandora.Service <IHttp>() .Implementor <Http>().Lifestyle.Transient(); pandora.Service <CoffeeHandlerImpl>() .Implementor <CoffeeHandlerImpl>().Lifestyle.Transient(); pandora.Service <IParameterSource>() .Implementor <QueryStringParameterSource>().Lifestyle.Transient(); if (configuration.CacheEnabled) { pandora.Service <IResponse>() .Implementor <CachedJavascriptResponse>().Lifestyle.Transient(); } else { pandora.Service <IResponse>() .Implementor <JavascriptResponse>().Lifestyle.Transient(); } pandora.Service <ICache>() .Implementor <HttpCache>().Lifestyle.Transient(); pandora.Service <ILogger>() .Implementor <AspResponseLogger>() .Parameters("level").Set("error-level") .Lifestyle.Transient(); pandora.Service <IPathResolver>() .Implementor <AspServerPathResolver>().Lifestyle.Transient(); }
private void RegisterCoreServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration) { pandora.Service <string>("compiler-path") .Instance(configuration.CompilerPath); pandora.Service <LogLevel>("error-level") .Instance(configuration.LogLevel); pandora.Service <string>("compiler-args") .Instance(configuration.CompilePattern); if (configuration.CacheEnabled) { pandora.Service <ICoffeeEngine>() .Implementor <CoffeeCacheDecorator>().Lifestyle.Transient(); } pandora.Service <ICoffeeEngine>() .Implementor <CoffeeEngine>() .Parameters("compilerPath").Set("compiler-path") .Parameters("compilerArguments").Set("compiler-args") .Lifestyle.Transient(); //pandora.Service<bool>("minify-output").Instance(configuration.MinifyOutput); pandora.Service <IFileReader>() .Implementor(configuration.LessSource); }
private void RegisterCoreServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration) { pandora.Service<string>("compiler-path") .Instance(configuration.CompilerPath); pandora.Service<LogLevel>("error-level") .Instance(configuration.LogLevel); pandora.Service<string>("compiler-args") .Instance(configuration.CompilePattern); if (configuration.CacheEnabled) pandora.Service<ICoffeeEngine>() .Implementor<CoffeeCacheDecorator>().Lifestyle.Transient(); pandora.Service<ICoffeeEngine>() .Implementor<CoffeeEngine>() .Parameters("compilerPath").Set("compiler-path") .Parameters("compilerArguments").Set("compiler-args") .Lifestyle.Transient(); //pandora.Service<bool>("minify-output").Instance(configuration.MinifyOutput); pandora.Service<IFileReader>() .Implementor(configuration.LessSource); }
private void RegisterServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration) { OverrideServices(pandora, configuration); RegisterWebServices(pandora, configuration); RegisterCoreServices(pandora, configuration); }
public IServiceLocator GetCoffeeContainer(CoffeeScriptConfiguration configuration) { var Container = new PandoraContainer(); Container.Register(pandora => RegisterServices(pandora, configuration)); return(new CommonServiceLocatorAdapter(Container)); }
public IServiceLocator GetCoffeeContainer(CoffeeScriptConfiguration configuration) { var Container = new PandoraContainer(); Container.Register(pandora => RegisterServices(pandora, configuration)); return new CommonServiceLocatorAdapter(Container); }
public CoffeeScriptHttpHandler() { mConfig = new WebConfigConfigurationLoader().GetCoffeeConfiguration(); mHandlerImpl = new ContainerFactory().GetCoffeeContainer(mConfig) .GetInstance <CoffeeHandlerImpl>(); }
private void RegisterWebServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration) { pandora.Service<IHttp>() .Implementor<Http>().Lifestyle.Transient(); pandora.Service<CoffeeHandlerImpl>() .Implementor<CoffeeHandlerImpl>().Lifestyle.Transient(); pandora.Service<IParameterSource>() .Implementor<QueryStringParameterSource>().Lifestyle.Transient(); if (configuration.CacheEnabled) pandora.Service<IResponse>() .Implementor<CachedJavascriptResponse>().Lifestyle.Transient(); else pandora.Service<IResponse>() .Implementor<JavascriptResponse>().Lifestyle.Transient(); pandora.Service<ICache>() .Implementor<HttpCache>().Lifestyle.Transient(); pandora.Service<ILogger>() .Implementor<AspResponseLogger>() .Parameters("level").Set("error-level") .Lifestyle.Transient(); pandora.Service<IPathResolver>() .Implementor<AspServerPathResolver>().Lifestyle.Transient(); }