예제 #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());
			}
		}