Esempio n. 1
0
        public BundleContents GetContents(IFileSystem fileSystem, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            fileSystem.ThrowIfNull("fileSystem");
            transformers.ThrowIfNull("transformers");
            concatenator.ThrowIfNull("concatenator");

            AssetFile[] unorderedAssets = _assets.SelectMany(arg => arg.ResolveAssetFiles(fileSystem)).ToArray();

            return(GetContents(fileSystem, unorderedAssets, concatenator, transformers));
        }
Esempio n. 2
0
        public BundleRoute(Bundle bundle, string routeName, string relativePath, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            bundle.ThrowIfNull("bundle");
            routeName.ThrowIfNull("routeName");
            relativePath.ThrowIfNull("relativePath");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            _bundle       = bundle;
            _routeName    = routeName;
            _relativePath = relativePath;
            _concatenator = concatenator;
            _transformers = transformers;
        }
Esempio n. 3
0
		public BundleRoute(Bundle bundle, string routeName, string relativePath, IAssetConcatenator concatenator, IEnumerable<IAssetTransformer> transformers)
		{
			bundle.ThrowIfNull("bundle");
			routeName.ThrowIfNull("routeName");
			relativePath.ThrowIfNull("relativePath");
			concatenator.ThrowIfNull("concatenator");
			transformers.ThrowIfNull("transformers");

			_bundle = bundle;
			_routeName = routeName;
			_relativePath = relativePath;
			_concatenator = concatenator;
			_transformers = transformers;
		}
Esempio n. 4
0
        public BundleWatcher(Bundle bundle, IFileSystem fileSystem, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            bundle.ThrowIfNull("bundle");
            fileSystem.ThrowIfNull("fileSystem");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            _bundle              = bundle;
            _concatenator        = concatenator;
            _transformers        = transformers.ToArray();
            _fileSystem          = fileSystem;
            _watchTimer.Elapsed += WatchTimerElapsed;
            RefreshContents();
            WatchForChanges();
        }
Esempio n. 5
0
        public BundleWatcher(Bundle bundle, IFileSystem fileSystem, IAssetConcatenator concatenator, IEnumerable<IAssetTransformer> transformers)
        {
            bundle.ThrowIfNull("bundle");
            fileSystem.ThrowIfNull("fileSystem");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            _bundle = bundle;
            _concatenator = concatenator;
            _transformers = transformers.ToArray();
            _fileSystem = fileSystem;
            _watchTimer.Elapsed += WatchTimerElapsed;
            RefreshContents();
            WatchForChanges();
        }
Esempio n. 6
0
        public BundleRoute(Bundle bundle, string routeName, Scheme scheme, string relativePath, IComparer <AssetFile> assetOrder, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            bundle.ThrowIfNull("bundle");
            routeName.ThrowIfNull("routeName");
            relativePath.ThrowIfNull("relativePath");
            assetOrder.ThrowIfNull("assetOrder");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            _bundle       = bundle;
            _routeName    = routeName;
            _scheme       = scheme;
            _relativePath = relativePath;
            _assetOrder   = assetOrder;
            _concatenator = concatenator;
            _transformers = transformers;
        }
        public AutoRouteCollection JavaScriptBundle(Bundle bundle, string routeName, Scheme scheme, string relativePath, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            ThrowIfNoContainer();

            bundle.ThrowIfNull("bundle");
            routeName.ThrowIfNull("routeName");
            relativePath.ThrowIfNull("relativePath");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            var watcher     = new BundleWatcher(bundle, _container.GetInstance <IFileSystem>(), concatenator, transformers);
            var guidFactory = _container.GetInstance <IGuidFactory>();
            var httpRuntime = _container.GetInstance <IHttpRuntime>();
            var systemClock = _container.GetInstance <ISystemClock>();
            var route       = new JavaScriptBundleWatcherRoute(routeName, guidFactory.Random(), scheme, relativePath, watcher, httpRuntime, systemClock);

            return(AdditionalRoutes(route));
        }
Esempio n. 8
0
        public AutoRouteCollection CssBundle(Bundle bundle, string routeName, string relativePath, IAssetConcatenator concatenator, IEnumerable <IAssetTransformer> transformers)
        {
            ThrowIfNoBundleDependencyContainer();

            bundle.ThrowIfNull("bundle");
            routeName.ThrowIfNull("routeName");
            relativePath.ThrowIfNull("relativePath");
            concatenator.ThrowIfNull("concatenator");
            transformers.ThrowIfNull("transformers");

            var watcher = new BundleWatcher(bundle, _bundleDependencyContainer.GetInstance <IFileSystem>(), concatenator, transformers);
            var route   = new CssBundleWatcherRoute(
                routeName,
                _bundleDependencyContainer.GetInstance <IGuidFactory>(),
                relativePath,
                watcher,
                _bundleDependencyContainer.GetInstance <IHttpRuntime>(),
                _bundleDependencyContainer.GetInstance <ISystemClock>());

            return(AdditionalRoutes(route));
        }
Esempio n. 9
0
        public BundleContents GetContents(IFileSystem fileSystem, IAssetConcatenator concatenator, IEnumerable<IAssetTransformer> transformers)
        {
            fileSystem.ThrowIfNull("fileSystem");
            transformers.ThrowIfNull("transformers");
            concatenator.ThrowIfNull("concatenator");

            AssetFile[] unorderedAssets = _assets.SelectMany(arg => arg.ResolveAssetFiles(fileSystem)).ToArray();

            return GetContents(fileSystem, unorderedAssets, concatenator, transformers);
        }