Beispiel #1
0
 /// <summary>
 /// Updates a collection cache with a given cache Id.
 /// </summary>
 /// <param name="cacheId"></param>
 /// <param name="cache"></param>
 public void SetCache(string cacheId, ICollectionCache cache)
 {
     //lock (_locker)
     //{
     //    _collectionCachePool.Add(cacheId, cache);
     //}
 }
Beispiel #2
0
        private void ReuseCacheFromPool()
        {
            // todo: include InstanceId to the cacheId...
            string           cacheId = string.Format("{0}{1}", File.Filename, GetId());
            ICollectionCache cache   = CachePoolManager.GetCache(cacheId);

            if (cache == null)
            {
                CachePoolManager.SetCache(cacheId, this);
            }
            else
            {
                MruManager = cache.MruManager;
                Blocks     = cache.Blocks;
                MruManager.SetDataStores(this, DataBlockDriver);
            }
        }
Beispiel #3
0
        private IBaseData InsertBaseData(ICollectionCache cache)
        {
            var inserter = new BaseDataInserter(cache, _context);

            inserter.ProgressMaxChanged   += OnProgressMaxChanged;
            inserter.ProgressValueChanged += OnProgressValueChanged;
            inserter.Feedback             += OnFeedback;

            try
            {
                inserter.Insert();
            }
            finally
            {
                inserter.ProgressMaxChanged   -= OnProgressMaxChanged;
                inserter.ProgressValueChanged -= OnProgressValueChanged;
                inserter.Feedback             -= OnFeedback;
            }

            return(inserter);
        }
Beispiel #4
0
 public DIService(ICollectionCache collectionCache)
 {
     this._collectionCache = collectionCache;
 }
Beispiel #5
0
 public BaseDataInserter(ICollectionCache cache, Entity.CollectionEntities context)
 {
     _cache   = cache;
     _context = context;
 }