Esempio n. 1
0
 void ICache.Save(IProgressIndicator progress, bool enablePersistence)
 {
     if (enablePersistence)
     {
         lock (_lock)
         {
             _persistentCache.Save(progress, _persistentIndexManager, (writer, file, data) => writer.Write(data));
         }
         _persistentCache.Dispose();
         _persistentCache = null;
     }
 }
Esempio n. 2
0
        public void Save(IProgressIndicator progress, bool enablePersistence)
        {
            if (!enablePersistence || _cacheFormatVersion < 0)
            {
                return;
            }

            Assertion.Assert(_persistentCache != null, "persistentCache != null");
            lock (_lockObject)
            {
                _persistentCache.Save(progress, _persistentIndexManager, WriteData);
            }

            // Apparently, Save also implies throws away
            _persistentCache = null;
        }