コード例 #1
0
ファイル: AspNetBundleContext.cs プロジェクト: irii/Bundler
        public AspNetBundleContext(IBundleConfiguration bundleConfiguration, IBundleDiagnostic diagnostic, IBundleVirtualPathProvider bundleVirtualPathProvider, IBundleFileWatcher bundleFileWatcher, IBundleUrlHelper bundleUrlHelper)
        {
            if (bundleConfiguration == null)
            {
                throw new ArgumentNullException(nameof(bundleConfiguration));
            }
            if (diagnostic == null)
            {
                throw new ArgumentNullException(nameof(diagnostic));
            }
            if (bundleVirtualPathProvider == null)
            {
                throw new ArgumentNullException(nameof(bundleVirtualPathProvider));
            }
            if (bundleFileWatcher == null)
            {
                throw new ArgumentNullException(nameof(bundleFileWatcher));
            }
            if (bundleUrlHelper == null)
            {
                throw new ArgumentNullException(nameof(bundleUrlHelper));
            }

            Configuration       = bundleConfiguration;
            Diagnostic          = diagnostic;
            VirtualPathProvider = bundleVirtualPathProvider;
            Watcher             = bundleFileWatcher;
            UrlHelper           = bundleUrlHelper;
        }
コード例 #2
0
        public BundleManagerFactory(IEnumerable <IBundleModelFactory> modelFactories, IBundleCache cache, IBundleVersionProvider versionProvider, IBundleUrlHelper urlHelper,
                                    ILoggerFactory loggerFactory, ISystemClock clock, IApplicationLifetime applicationLifetime)
        {
            _modelFactories  = modelFactories;
            _cache           = cache;
            _versionProvider = versionProvider;
            _urlHelper       = urlHelper;

            _loggerFactory = loggerFactory;
            _clock         = clock;

            _shutdownToken = applicationLifetime.ApplicationStopping;

            _instances = new List <IBundleManager>();
        }
コード例 #3
0
        public BundleManager(int id, BundleCollection bundles, IBundlingContext bundlingContext, CancellationToken shutdownToken,
                             IEnumerable <IBundleModelFactory> modelFactories, IBundleCache cache, IBundleVersionProvider versionProvider, IBundleUrlHelper urlHelper,
                             ILoggerFactory loggerFactory, ISystemClock clock)
        {
            _id = id;
            _bundlingContext = bundlingContext;
            _shutdownToken   = shutdownToken;

            _modelFactories  = modelFactories;
            _cache           = cache;
            _versionProvider = versionProvider;
            _urlHelper       = urlHelper;

            _logger = loggerFactory.CreateLogger <BundleManager>();
            _clock  = clock;

            _bundles = bundles.ToDictionary(b => b.Path, CreateModel);
        }