Update() public method

public Update ( System.Runtime.Caching.MemoryCacheEntry entry ) : void
entry System.Runtime.Caching.MemoryCacheEntry
return void
コード例 #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);
                 }
             }
         }
     }
 }
コード例 #2
0
 internal void UpdateUsage(DateTime utcNow, CacheUsage usage)
 {
     if (this.InUsage() && (this._utcLastUpdateUsage < (utcNow - CacheUsage.CORRELATED_REQUEST_TIMEOUT)))
     {
         this._utcLastUpdateUsage = utcNow;
         usage.Update(this);
         if ((this._fields != null) && (this._fields._dependencies != null))
         {
             foreach (ChangeMonitor monitor in this._fields._dependencies)
             {
                 MemoryCacheEntryChangeMonitor monitor2 = monitor as MemoryCacheEntryChangeMonitor;
                 if (monitor2 != null)
                 {
                     foreach (MemoryCacheEntry entry in monitor2.Dependencies)
                     {
                         MemoryCacheStore store = entry._fields._cache.GetStore(entry);
                         entry.UpdateUsage(utcNow, store.Usage);
                     }
                 }
             }
         }
     }
 }
コード例 #3
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);
                 }
             }
         }
     }
 }
 internal void UpdateUsage(DateTime utcNow, CacheUsage usage)
 {
     if (this.InUsage() && (this._utcLastUpdateUsage < (utcNow - CacheUsage.CORRELATED_REQUEST_TIMEOUT)))
     {
         this._utcLastUpdateUsage = utcNow;
         usage.Update(this);
         if ((this._fields != null) && (this._fields._dependencies != null))
         {
             foreach (ChangeMonitor monitor in this._fields._dependencies)
             {
                 MemoryCacheEntryChangeMonitor monitor2 = monitor as MemoryCacheEntryChangeMonitor;
                 if (monitor2 != null)
                 {
                     foreach (MemoryCacheEntry entry in monitor2.Dependencies)
                     {
                         MemoryCacheStore store = entry._fields._cache.GetStore(entry);
                         entry.UpdateUsage(utcNow, store.Usage);
                     }
                 }
             }
         }
     }
 }