/// <summary> /// Load store state and data from persistent medium. /// </summary> void IPersistentCacheStorage.LoadStorageState() { try { lock (_itemDict.SyncRoot) { _itemDict.Clear(); for (IEnumerator i = _internalStore.GetEnumerator(); i.MoveNext();) { MemArena arena = (MemArena)i.Current; if (!arena.IsFree) { byte[] data = arena.GetMemContents(); StoreItem item = StoreItem.FromBinary(data, CacheContext); _itemDict.Add(item.Key, new MmfObjectPtr(arena.View, arena)); } } } } catch (Exception e) { Trace.error("MmfStorageProvider.IPersistentCacheStorage()", e.ToString()); } }
/// <summary> /// Carrega o estado do armazenamento. /// </summary> void IPersistentCacheStorage.LoadStorageState() { try { lock (_itemDict.SyncRoot) { _itemDict.Clear(); IEnumerator enumerator = _internalStore.GetEnumerator(); while (enumerator.MoveNext()) { MemArea current = (MemArea)enumerator.Current; if (!current.IsFree) { StoreItem item = StoreItem.FromBinary(current.GetMemContents(), base.CacheContext); _itemDict.Add(item.Key, new MmfObjectPtr(current.View, current)); } } } } catch (Exception exception) { Trace.Error("MmfStorageProvider.IPersistentCacheStorage()".GetFormatter(), exception.GetFormatter()); } }