Beispiel #1
0
 /// <summary>
 /// Try to get a cached entry.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="entry">The entry.</param>
 /// <returns>True if the cache contained an entry for the key.</returns>
 public bool TryGet(ScramCacheKey key, out ScramCacheEntry entry)
 {
     if (key.Equals(_cacheKey))
     {
         entry = _cachedEntry;
         return(true);
     }
     else
     {
         entry = null;
         return(false);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Add a cached entry.
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="entry">The entry.</param>
 public void Add(ScramCacheKey key, ScramCacheEntry entry)
 {
     _cacheKey    = key;
     _cachedEntry = entry;
 }