Ejemplo 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));
        }
Ejemplo 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;
        }
Ejemplo 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;
		}
Ejemplo 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();
        }
Ejemplo 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();
        }
Ejemplo 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;
        }
Ejemplo n.º 7
0
        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));
        }
Ejemplo 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));
        }
Ejemplo 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);
        }