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

            _cacheLevelMap[Weak.ReferenceType]   = Weak;
            _cacheLevelMap[Strong.ReferenceType] = Strong;
        }
コード例 #2
0
        /// <summary>
        /// 
        /// </summary>
        static MemoryCacheLevel()
        {
            Weak = new MemoryCacheLevel("WEAK");
            Strong = new MemoryCacheLevel("STRONG");

            _cacheLevelMap[Weak.ReferenceType] = Weak;
            _cacheLevelMap[Strong.ReferenceType] = Strong;
        }
コード例 #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());
            }
        }
コード例 #4
0
        public void Configure(IDictionary properties)
        {
            string str = (string)properties["Type"];

            if (str != null)
            {
                this._cacheLevel = MemoryCacheLevel.GetByRefenceType(str.ToUpper());
            }
        }
コード例 #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);
        }
コード例 #6
0
 /// <summary>
 /// Configures the cache
 /// </summary>
 public void Configure(IDictionary properties)
 {
     string referenceType = (string)properties["Type"];;
     if (referenceType != null)
     {
         _cacheLevel = MemoryCacheLevel.GetByRefenceType(referenceType.ToUpper());
     }
 }