Ejemplo n.º 1
0
        /// <summary>
        ///     Tries the get value.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="jsonBackedField">The json backed field.</param>
        /// <param name="result">The result.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        public bool TryGetValue <T>(JsonBackedDataBase jsonBackedField, out T result)
        {
            object cachedValue;

            if (r_Cache.TryGetValue(jsonBackedField, out cachedValue))
            {
                result = (T)cachedValue;
                return(true);
            }
            result = default(T);
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Sets the value.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="jsonBackedField">The json backed field.</param>
 /// <param name="value">The value.</param>
 public void SetValue <T>(JsonBackedDataBase jsonBackedField, T value)
 {
     r_Cache[jsonBackedField] = value;
 }