public static PreProcessPipeline Create <T1, T2, T3>(this PreProcessPipelineFactory pipelineFactory)
     where T1 : IPreProcessor
     where T2 : IPreProcessor
     where T3 : IPreProcessor
 {
     return(pipelineFactory.Create(typeof(T1), typeof(T2), typeof(T3)));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="context"></param>
        /// <param name="config"></param>
        /// <param name="fileManager"></param>
        /// <param name="fileSystemHelper"></param>
        /// <param name="hasher"></param>
        /// <param name="bundleManager"></param>
        /// <param name="http"></param>
        /// <param name="processorFactory"></param>
        public SmidgeHelper(
            SmidgeContext context,
            ISmidgeConfig config, 
            PreProcessManager fileManager, 
            FileSystemHelper fileSystemHelper, 
            IHasher hasher, 
            BundleManager bundleManager,
            IHttpContextAccessor http,
            PreProcessPipelineFactory processorFactory)
        {
            _processorFactory = processorFactory;
            _bundleManager = bundleManager;
            _hasher = hasher;
            _fileManager = fileManager;
            _context = context;
            _config = config;
            _fileSystemHelper = fileSystemHelper;
            _request = http.HttpContext.Request;

            _fileBatcher = new FileBatcher(_fileSystemHelper, _request, _hasher);
        }
Exemplo n.º 3
0
 public BundleManager(FileSystemHelper fileSystemHelper, PreProcessPipelineFactory processorFactory, IOptions<Bundles> bundles)
 {
     _processorFactory = processorFactory;
     _bundles = bundles.Options;
     _fileSystemHelper = fileSystemHelper;
 }
Exemplo n.º 4
0
 public BundleManager(FileSystemHelper fileSystemHelper, IOptions<Bundles> bundles, PreProcessPipelineFactory processorFactory)
 {
     _bundles = bundles.Value;
     _fileSystemHelper = fileSystemHelper;
     _processorFactory = processorFactory;
 }
 public static PreProcessPipeline Create <T1>(this PreProcessPipelineFactory pipelineFactory)
     where T1 : IPreProcessor
 {
     return(pipelineFactory.Create(typeof(T1)));
 }
 /// <summary>
 /// Replaces a pre processor type with another at the same index
 /// </summary>
 /// <typeparam name="TRemove"></typeparam>
 /// <typeparam name="TAdd"></typeparam>
 /// <param name="pipeline"></param>
 /// <param name="pipelineFactory"></param>
 /// <returns></returns>
 public static PreProcessPipeline Replace <TRemove, TAdd>(this PreProcessPipeline pipeline, PreProcessPipelineFactory pipelineFactory)
     where TRemove : IPreProcessor
     where TAdd : IPreProcessor
 {
     for (int i = 0; i < pipeline.Processors.Count; i++)
     {
         if (pipeline.Processors[i].GetType() == typeof(TRemove))
         {
             pipeline.Processors.RemoveAt(i);
             pipeline.Processors.Insert(i, pipelineFactory.Resolve <TAdd>());
         }
     }
     return(pipeline);
 }
 /// <summary>
 /// Resolves an instance of a pre processor based on type
 /// </summary>
 /// <returns></returns>
 public static IPreProcessor Resolve <T>(this PreProcessPipelineFactory pipelineFactory)
     where T : IPreProcessor
 {
     return(pipelineFactory.Resolve(typeof(T)));
 }
 public static PreProcessPipeline DefaultCss(this PreProcessPipelineFactory pipelineFactory)
 {
     return(pipelineFactory.CreateDefault(WebFileType.Css));
 }