コード例 #1
0
ファイル: CacheManager.cs プロジェクト: Tony-Liang/Common
        /// <summary>
        /// 
        /// </summary>
        /// <param name="realCache"></param>
        /// <param name="backgroundScheduler"></param>
        /// <param name="pollTimer"></param>
        public CacheManager(Cache realCache, BackgroundScheduler backgroundScheduler, ExpirationPollTimer pollTimer)
        {
            if (pollTimer == null) throw new ArgumentNullException("pollTimer");

            this.realCache = realCache;
            this.pollTimer = pollTimer;
            this.backgroundScheduler = backgroundScheduler;

            pollTimer.StartPolling(backgroundScheduler.ExpirationTimeoutExpired);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="realCache"></param>
        /// <param name="backgroundScheduler"></param>
        /// <param name="pollTimer"></param>
        public CacheManager(Cache realCache, BackgroundScheduler backgroundScheduler, ExpirationPollTimer pollTimer)
        {
            if (pollTimer == null)
            {
                throw new ArgumentNullException("pollTimer");
            }

            this.realCache           = realCache;
            this.pollTimer           = pollTimer;
            this.backgroundScheduler = backgroundScheduler;


            pollTimer.StartPolling(backgroundScheduler.ExpirationTimeoutExpired);
        }
コード例 #3
0
        /// <summary>
        /// Not intended for public use. Only public due to requirements of IDisposable. If you call this method, your
        /// cache will be unusable.
        /// </summary>
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (pollTimer != null)
            {
                pollTimer.StopPolling();
                pollTimer = null;
            }
            if (realCache != null)
            {
                realCache.Dispose();
                realCache = null;
            }
        }
コード例 #4
0
ファイル: CacheManager.cs プロジェクト: Tony-Liang/Common
        /// <summary>
        /// Not intended for public use. Only public due to requirements of IDisposable. If you call this method, your
        /// cache will be unusable.
        /// </summary>
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (pollTimer != null)
            {
                pollTimer.StopPolling();
                pollTimer = null;
            }
            if (realCache != null)
            {
                realCache.Dispose();
                realCache = null;
            }
        }