Пример #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;
		}
        /// <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
        /// <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);
        }
Пример #5
0
		/// <summary>
		/// Configures the cache
		/// </summary>
		public void Configure(IDictionary properties)
		{
			string referenceType = (string)properties["Type"];;
			if (referenceType != null) 
			{
				_cacheLevel = MemoryCacheLevel.GetByRefenceType(referenceType.ToUpper());
			}
		}