示例#1
0
        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();
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        private void RegisterServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration)
        {
            OverrideServices(pandora, configuration);

            RegisterWebServices(pandora, configuration);

            RegisterCoreServices(pandora, configuration);
        }
示例#5
0
        public IServiceLocator GetCoffeeContainer(CoffeeScriptConfiguration configuration)
        {
            var Container = new PandoraContainer();

            Container.Register(pandora => RegisterServices(pandora, configuration));

            return(new CommonServiceLocatorAdapter(Container));
        }
示例#6
0
        public IServiceLocator GetCoffeeContainer(CoffeeScriptConfiguration configuration)
        {
            var Container = new PandoraContainer();

            Container.Register(pandora => RegisterServices(pandora, configuration));

            return new CommonServiceLocatorAdapter(Container);
        }
示例#7
0
 public CoffeeScriptHttpHandler()
 {
     mConfig      = new WebConfigConfigurationLoader().GetCoffeeConfiguration();
     mHandlerImpl = new ContainerFactory().GetCoffeeContainer(mConfig)
                    .GetInstance <CoffeeHandlerImpl>();
 }
示例#8
0
        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();
        }
示例#9
0
        private void RegisterServices(FluentRegistration pandora, CoffeeScriptConfiguration configuration)
        {
            OverrideServices(pandora, configuration);

            RegisterWebServices(pandora, configuration);

            RegisterCoreServices(pandora, configuration);
        }