Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        static MemoryCacheLevel()
        {
            Weak   = new MemoryCacheLevel("WEAK");
            Strong = new MemoryCacheLevel("STRONG");

            _cacheLevelMap[Weak.ReferenceType]   = Weak;
            _cacheLevelMap[Strong.ReferenceType] = Strong;
        }
        /// <summary>
        /// 
        /// </summary>
        static MemoryCacheLevel()
        {
            Weak = new MemoryCacheLevel("WEAK");
            Strong = new MemoryCacheLevel("STRONG");

            _cacheLevelMap[Weak.ReferenceType] = Weak;
            _cacheLevelMap[Strong.ReferenceType] = Strong;
        }
Exemple #3
0
        /// <summary>
        /// Configures the cache
        /// </summary>
        public void Configure(IDictionary properties)
        {
            string referenceType = (string)properties["Type"];;

            if (referenceType != null)
            {
                _cacheLevel = MemoryCacheLevel.GetByRefenceType(referenceType.ToUpper());
            }
        }
        public void Configure(IDictionary properties)
        {
            string str = (string)properties["Type"];

            if (str != null)
            {
                this._cacheLevel = MemoryCacheLevel.GetByRefenceType(str.ToUpper());
            }
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="referenceType"></param>
        /// <returns></returns>
        public static MemoryCacheLevel GetByRefenceType(string referenceType)
        {
            MemoryCacheLevel cacheLevel = (MemoryCacheLevel)_cacheLevelMap[referenceType];

            if (cacheLevel == null)
            {
                throw new DataMapperException("Error getting CacheLevel (reference type) for name: '" + referenceType + "'.");
            }
            return(cacheLevel);
        }
 /// <summary>
 /// Configures the cache
 /// </summary>
 public void Configure(IDictionary properties)
 {
     string referenceType = (string)properties["Type"];;
     if (referenceType != null)
     {
         _cacheLevel = MemoryCacheLevel.GetByRefenceType(referenceType.ToUpper());
     }
 }