Combine() public method

Combines the files in this bundle into one.
public Combine ( ) : string
return string
Exemplo n.º 1
0
        public static void AddBundleToCache(Bundle bundle)
        {
            Bundle alreadyThere;

            _bundlesLock.EnterReadLock();

            try
            {
                alreadyThere = _bundles.SingleOrDefault(x => x.Hash == bundle.Hash);
            }
            finally
            {
                _bundlesLock.ExitReadLock();
            }

            if (alreadyThere == null)
            {
                AddBundleIfNotThere(bundle);
            }
            else
            {
                bundle = alreadyThere;
            }

            lock (bundle)
            {
                if (!IsBundleInCache(bundle))
                {
                    var result = bundle.Combine();
                    _cache.Set(bundle.Hash, result, new CacheItemPolicy()
                    {
                        AbsoluteExpiration = bundle.LastCacheInvalidationDate.AddDays(7)
                    });
                }
            }
        }
Exemplo n.º 2
0
        public static void AddBundleToCache(Bundle bundle)
        {
            Bundle alreadyThere;

            _bundlesLock.EnterReadLock();

            try
            {
                alreadyThere = _bundles.SingleOrDefault(x => x.Hash == bundle.Hash);
            }
            finally 
            {
                _bundlesLock.ExitReadLock();
            }

            if (alreadyThere == null)
            {
                AddBundleIfNotThere(bundle);
            }
            else
            {
                bundle = alreadyThere;
            }

            lock (bundle)
            {
                if (!IsBundleInCache(bundle))
                {
                    var result = bundle.Combine();
                    _cache.Set(bundle.Hash, result, new CacheItemPolicy() { AbsoluteExpiration = bundle.LastCacheInvalidationDate.AddDays(7) });
                }
            }
        }