Inheritance: IDisposable
Ejemplo n.º 1
0
        /// <summary>
        /// Reset the number of cached requests and clear the entire cache
        /// Mostly used for testing
        /// </summary>
        public void ResetCache(int? newMaxNumberOfCachedRequests = null)
        {

            if (newMaxNumberOfCachedRequests != null && newMaxNumberOfCachedRequests.Value == maxNumberOfCachedRequests)
                return;

            if (cache != null)
                cache.Dispose();

            if (newMaxNumberOfCachedRequests != null)
            {
                maxNumberOfCachedRequests = newMaxNumberOfCachedRequests.Value;
            }
            cache = new SimpleCache(maxNumberOfCachedRequests);
            NumOfCachedRequests = 0;
        }
		/// <summary>
		/// Reset the number of cached requests and clear the entire cache
		/// Mostly used for testing
		/// </summary>
		public void ResetCache()
		{
			if (cache != null)
				cache.Dispose();

			cache = new SimpleCache(maxNumberOfCachedRequests);
			NumOfCachedRequests = 0;
		}