Exemple #1
0
 protected virtual void RegisterLocalServices(FluentRegistration pandora)
 {
     pandora.Service <ICache>().Implementor <InMemoryCache>();
     pandora.Service <IParameterSource>().Implementor <ConsoleArgumentParameterSource>();
     pandora.Service <ILogger>().Implementor <ConsoleLogger>().Parameters("level").Set("error-level");
     pandora.Service <IPathResolver>().Implementor <RelativePathResolver>();
 }
        private void RegisterWebServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service<IHttp>().Implementor<Http>().Lifestyle.Transient();
            pandora.Service<HandlerImpl>().Implementor<HandlerImpl>().Lifestyle.Transient();

            if (!configuration.DisableParameters)
            {
                pandora.Service<IParameterSource>().Implementor<QueryStringParameterSource>().Lifestyle.Transient();
            }

            var responseService = configuration.CacheEnabled ?
                pandora.Service<IResponse>().Implementor<CachedCssResponse>() :
                pandora.Service<IResponse>().Implementor<CssResponse>();

            responseService.Parameters("isCompressionHandledByResponse").Set("default-is-compression-handled-by-response").Lifestyle.Transient();
            pandora.Service<bool>("default-is-compression-handled-by-response").Instance(configuration.HandleWebCompression);

            pandora.Service<ICache>().Implementor<HttpCache>().Lifestyle.Transient();
            pandora.Service<ILogger>().Implementor<AspResponseLogger>().Parameters("level").Set("error-level").Lifestyle.Transient();

            if (configuration.MapPathsToWeb)
                pandora.Service<IPathResolver>().Implementor<AspServerPathResolver>().Lifestyle.Transient();
            else
                pandora.Service<IPathResolver>().Implementor<AspRelativePathResolver>().Lifestyle.Transient();
        }
 private void RegisterLocalServices(FluentRegistration pandora)
 {
     pandora.Service<ICache>().Implementor<InMemoryCache>();
     pandora.Service<IParameterSource>().Implementor<ConsoleArgumentParameterSource>();
     pandora.Service<ILogger>().Implementor<ConsoleLogger>().Parameters("level").Set("error-level");
     pandora.Service<IPathResolver>().Implementor<RelativePathResolver>();
 }
Exemple #4
0
        private void RegisterWebServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service <IHttp>().Implementor <Http>().Lifestyle.Transient();
            pandora.Service <HandlerImpl>().Implementor <HandlerImpl>().Lifestyle.Transient();

            var responseService = configuration.CacheEnabled ?
                                  pandora.Service <IResponse>().Implementor <CachedCssResponse>() :
                                  pandora.Service <IResponse>().Implementor <CssResponse>();

            responseService.Parameters("isCompressionHandledByResponse").Set("default-is-compression-handled-by-response").Lifestyle.Transient();
            pandora.Service <bool>("default-is-compression-handled-by-response").Instance(configuration.HandleWebCompression);

            if (configuration.CacheEnabled)
            {
                responseService.Parameters("httpExpiryInMinutes").Set("http-expiry-in-minutes").Lifestyle.Transient();
                pandora.Service <int>("http-expiry-in-minutes").Instance(configuration.HttpExpiryInMinutes);
            }

            pandora.Service <ICache>().Implementor <HttpCache>().Lifestyle.Transient();
            pandora.Service <ILogger>().Implementor <AspResponseLogger>().Parameters("level").Set("error-level").Lifestyle.Transient();

            if (configuration.MapPathsToWeb)
            {
                pandora.Service <IPathResolver>().Implementor <AspServerPathResolver>().Lifestyle.Transient();
            }
            else
            {
                pandora.Service <IPathResolver>().Implementor <AspRelativePathResolver>().Lifestyle.Transient();
            }
        }
Exemple #5
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();
        }
 protected override void RegisterParameterSource(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     if (!configuration.DisableParameters)
     {
         pandora.Service<IParameterSource>().Implementor<QueryStringParameterSource>().Lifestyle.Transient();
     }
 }
Exemple #7
0
 protected virtual void OverrideServices(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     if (configuration.Logger != null)
     {
         pandora.Service <ILogger>().Implementor(configuration.Logger);
     }
 }
 protected override void RegisterParameterSource(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     if (!configuration.DisableParameters)
     {
         pandora.Service <IParameterSource>().Implementor <QueryStringParameterSource>().Lifestyle.Transient();
     }
 }
Exemple #9
0
        private void RegisterCoreServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service<LogLevel>("error-level")
                .Instance(configuration.LogLevel);

            pandora.Service<int>("default-optimization")
                .Instance(configuration.Optimization);

            pandora.Service<bool>("minify-output")
                .Instance(configuration.MinifyOutput);

            pandora.Service<IStylizer>()
                .Implementor<PlainStylizer>();

            pandora.Service<Parser.Parser>()
                .Implementor<Parser.Parser>()
                    .Parameters("optimization").Set("default-optimization")
                .Lifestyle.Transient();

            pandora.Service<ILessEngine>()
                .Implementor<ParameterDecorator>().Lifestyle.Transient();

            if (configuration.CacheEnabled)
                pandora.Service<ILessEngine>()
                    .Implementor<CacheDecorator>().Lifestyle.Transient();

            pandora.Service<ILessEngine>()
                .Implementor<LessEngine>()
                    .Parameters("compress").Set("minify-output")
                .Lifestyle.Transient();

            pandora.Service<IFileReader>()
                .Implementor(configuration.LessSource);
        }
Exemple #10
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);
        }
Exemple #11
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);
        }
        private void RegisterWebServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service<IHttp>().Implementor<Http>().Lifestyle.Transient();
            pandora.Service<HandlerImpl>().Implementor<HandlerImpl>().Lifestyle.Transient();
            pandora.Service<IParameterSource>().Implementor<QueryStringParameterSource>().Lifestyle.Transient();

            if (configuration.CacheEnabled)
                pandora.Service<IResponse>().Implementor<CachedCssResponse>().Lifestyle.Transient();
            else
                pandora.Service<IResponse>().Implementor<CssResponse>().Lifestyle.Transient();

            pandora.Service<ICache>().Implementor<HttpCache>().Lifestyle.Transient();
            pandora.Service<ILogger>().Implementor<AspResponseLogger>().Parameters("level").Set("error-level").Lifestyle.Transient();

            if (configuration.MapPathsToWeb)
                pandora.Service<IPathResolver>().Implementor<AspServerPathResolver>().Lifestyle.Transient();
            else
                pandora.Service<IPathResolver>().Implementor<AspRelativePathResolver>().Lifestyle.Transient();
        }
Exemple #13
0
        private void RegisterCoreServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service <LogLevel>("error-level").Instance(configuration.LogLevel);
            pandora.Service <IStylizer>().Implementor <PlainStylizer>();

            pandora.Service <Parser.Parser>().Implementor <Parser.Parser>().Parameters("optimization").Set("default-optimization").Lifestyle.Transient();
            pandora.Service <int>("default-optimization").Instance(configuration.Optimization);

            pandora.Service <ILessEngine>().Implementor <ParameterDecorator>().Lifestyle.Transient();

            if (configuration.CacheEnabled)
            {
                pandora.Service <ILessEngine>().Implementor <CacheDecorator>().Lifestyle.Transient();
            }

            pandora.Service <ILessEngine>().Implementor <LessEngine>().Parameters("compress").Set("minify-output").Lifestyle.Transient();
            pandora.Service <bool>("minify-output").Instance(configuration.MinifyOutput);

            pandora.Service <IFileReader>().Implementor(configuration.LessSource);
        }
        private void RegisterWebServices(FluentRegistration pandora)
        {
            pandora.Service<HttpContextBase>().Instance(_context);
            pandora.Service<IHttp>().Implementor<Http>();
            pandora.Service<IFileReader>().Implementor<VirtualFileReader>();
            pandora.Service<VirtualPathProvider>().Instance(_virtualPathProvider);

            //if (!configuration.DisableParameters)
            //{
            //    pandora.Service<IParameterSource>().Implementor<QueryStringParameterSource>().Lifestyle.Transient();
            //}

            pandora.Service<ICache>().Implementor<HttpCache>().Lifestyle.Transient();
            pandora.Service<ILogger>().Instance(_logger);

            pandora.Service<IPathResolver>().Implementor<AspServerPathResolver>().Lifestyle.Transient();
        }
Exemple #15
0
 protected virtual void RegisterParameterSource(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     pandora.Service <IParameterSource>().Implementor <NullParameterSource>().Lifestyle.Transient();
 }
 protected override void OverrideServices(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     pandora.Service<ILogger>().Instance(logger);
     pandora.Service<IPathResolver>().Instance(pathResolver);
 }
Exemple #17
0
        protected virtual void RegisterCoreServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service <LogLevel>("error-level").Instance(configuration.LogLevel);
            pandora.Service <IStylizer>().Implementor <PlainStylizer>();

            var importer = pandora.Service <IImporter>().Implementor <Importer>();

            importer.Parameters("inlineCssFiles").Set("default-inline-css-files").Lifestyle.Transient();
            importer.Parameters("disableUrlRewriting").Set("default-disable-url-rewriting").Lifestyle.Transient();
            importer.Parameters("importAllFilesAsLess").Set("default-import-all-files-as-less").Lifestyle.Transient();

            pandora.Service <bool>("default-disable-url-rewriting").Instance(configuration.DisableUrlRewriting);
            pandora.Service <bool>("default-inline-css-files").Instance(configuration.InlineCssFiles);
            pandora.Service <bool>("default-import-all-files-as-less").Instance(configuration.ImportAllFilesAsLess);

            pandora.Service <Parser.Parser>().Implementor <Parser.Parser>().Parameters("optimization").Set("default-optimization").Lifestyle.Transient();
            pandora.Service <int>("default-optimization").Instance(configuration.Optimization);

            if (!configuration.DisableParameters)
            {
                pandora.Service <ILessEngine>().Implementor <ParameterDecorator>().Lifestyle.Transient();
            }

            if (configuration.CacheEnabled)
            {
                pandora.Service <ILessEngine>().Implementor <CacheDecorator>().Lifestyle.Transient();
            }

            pandora.Service <ILessEngine>().Implementor <LessEngine>()
            .Parameters("compress").Set("minify-output")
            .Parameters("debug").Set("debug")
            .Lifestyle.Transient();
            pandora.Service <bool>("minify-output").Instance(configuration.MinifyOutput);
            pandora.Service <bool>("debug").Instance(configuration.Debug);

            pandora.Service <ILessEngine>().Implementor <LessEngine>().Parameters("plugins").Set("default-plugins").Lifestyle.Transient();
            pandora.Service <IEnumerable <IPluginConfigurator> >("default-plugins").Instance(configuration.Plugins);

            pandora.Service <IFileReader>().Implementor(configuration.LessSource);
        }
Exemple #18
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();
        }
 protected virtual void OverrideServices(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     if (configuration.Logger != null)
         pandora.Service<ILogger>().Implementor(configuration.Logger);
 }
        protected virtual void RegisterCoreServices(FluentRegistration pandora, DotlessConfiguration configuration)
        {
            pandora.Service<LogLevel>("error-level").Instance(configuration.LogLevel);
            pandora.Service<IStylizer>().Implementor<PlainStylizer>();

            var importer = pandora.Service<IImporter>().Implementor<Importer>();

            importer.Parameters("inlineCssFiles").Set("default-inline-css-files").Lifestyle.Transient();
            importer.Parameters("disableUrlRewriting").Set("default-disable-url-rewriting").Lifestyle.Transient();
            importer.Parameters("importAllFilesAsLess").Set("default-import-all-files-as-less").Lifestyle.Transient();

            pandora.Service<bool>("default-disable-url-rewriting").Instance(configuration.DisableUrlRewriting);
            pandora.Service<bool>("default-inline-css-files").Instance(configuration.InlineCssFiles);
            pandora.Service<bool>("default-import-all-files-as-less").Instance(configuration.ImportAllFilesAsLess);

            pandora.Service<Parser.Parser>().Implementor<Parser.Parser>().Parameters("optimization").Set("default-optimization").Lifestyle.Transient();
            pandora.Service<int>("default-optimization").Instance(configuration.Optimization);

            if (!configuration.DisableParameters)
                pandora.Service<ILessEngine>().Implementor<ParameterDecorator>().Lifestyle.Transient();

            if (configuration.CacheEnabled)
                pandora.Service<ILessEngine>().Implementor<CacheDecorator>().Lifestyle.Transient();

            pandora.Service<ILessEngine>().Implementor<LessEngine>()
                .Parameters("compress").Set("minify-output")
                .Parameters("debug").Set("debug")
                .Parameters("disableVariableRedefines").Set("disableVariableRedefines")
                .Lifestyle.Transient();
            pandora.Service<bool>("minify-output").Instance(configuration.MinifyOutput);
            pandora.Service<bool>("debug").Instance(configuration.Debug);
            pandora.Service<bool>("disableVariableRedefines").Instance(configuration.DisableVariableRedefines);

            pandora.Service<ILessEngine>().Implementor<LessEngine>().Parameters("plugins").Set("default-plugins").Lifestyle.Transient();
            pandora.Service<IEnumerable<IPluginConfigurator>>("default-plugins").Instance(configuration.Plugins);

            pandora.Service<IFileReader>().Implementor(configuration.LessSource);
        }
 protected virtual void RegisterParameterSource(FluentRegistration pandora, DotlessConfiguration configuration)
 {
     pandora.Service<IParameterSource>().Implementor<NullParameterSource>().Lifestyle.Transient();
 }