System.Runtime.Caching.CacheUsage.Update C# (CSharp) Méthode

Update() public méthode

public Update ( System.Runtime.Caching.MemoryCacheEntry entry ) : void
entry System.Runtime.Caching.MemoryCacheEntry
Résultat void
		public void Update (MemoryCacheEntry entry)
		{
			base.Remove (entry);
			entry.UtcLastUpdateUsage = DateTime.UtcNow;
			base.Add (entry);
		}

Usage Example

Exemple #1
0
 internal void UpdateUsage(DateTime utcNow, CacheUsage usage)
 {
     // update, but not more frequently than once per second.
     if (InUsage() && _utcLastUpdateUsage < utcNow - CacheUsage.CORRELATED_REQUEST_TIMEOUT)
     {
         _utcLastUpdateUsage = utcNow;
         usage.Update(this);
         if (_fields != null && _fields._dependencies != null)
         {
             foreach (ChangeMonitor monitor in _fields._dependencies)
             {
                 MemoryCacheEntryChangeMonitor m = monitor as MemoryCacheEntryChangeMonitor;
                 if (m == null)
                 {
                     continue;
                 }
                 foreach (MemoryCacheEntry e in m.Dependencies)
                 {
                     MemoryCacheStore store = e._fields._cache.GetStore(e);
                     e.UpdateUsage(utcNow, store.Usage);
                 }
             }
         }
     }
 }
All Usage Examples Of System.Runtime.Caching.CacheUsage::Update