Evolution/Evolution/Utils/Cache.cs
/// <summary>
/// Tries to get the value associated with the key in the cached
/// </summary>
/// <param name="key">The key.</param>
/// <param name="value">The associated value.</param>
/// <returns>True if the key was found, false otherwise</returns>
Tries to get the value associated with the key in the cached
Tries to get the value associated with the key in the cached
public bool TryGet(K key, out V value)
        {
            lock (lockObj)
            {
                KeyValuePair<LinkedListNode<K>,V> item;
                bool success = cache.TryGetValue(key, out item);
                if (success)
                {
                    fetchOrder.Remove(item.Key);
                    fetchOrder.AddFirst(item.Key);
                }
                value = item.Key == null ? item.Value : default(V);
                return success;
            }
        }
public bool TryGet ( K key , out V value ) { lock ( lockObj ) { KeyValuePair < LinkedListNode < K > , V > item ; bool success = cache . TryGetValue ( key , out item ) ; if ( success ) { fetchOrder . Remove ( item . Key ) ; fetchOrder . AddFirst ( item . Key ) ; } value = item . Key == null ? item . Value : default ( V ) ; return success ; } }
Tries to get the value associated with the key in the cached
Tries to get the value associated with the key in the cached
True if the key was found, false otherwise
True if the key was found false otherwise
key
K
None
V
out
value
The associated value.
The associated value .