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

            _cacheLevelMap[Weak.ReferenceType]   = Weak;
            _cacheLevelMap[Strong.ReferenceType] = Strong;
        }
Example #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());
            }
        }
        /// <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());
			}
		}