Exemplo n.º 1
0
 /// <summary>
 /// Starts pruning the specified pruneable based on the rules of the pruner.
 /// </summary>
 /// <param name="pruneable">The pruneable that will be pruned.</param>
 public void Start(IPruneable pruneable)
 {
     this.caches.Add(pruneable);
     if (this.timer == null)
     {
         this.timer = new Timer(this.PruneCacheIfGarbageCollectorHasRun, null, this.GetTimeoutInMilliseconds(), Timeout.Infinite);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Starts pruning the specified pruneable based on the rules of the pruner.
        /// </summary>
        /// <param name="pruneable">The pruneable that will be pruned.</param>
        /// <exception cref="ArgumentNullException"><paramref name="pruneable"/> is <see langword="null"/>.</exception>
        public void Start(IPruneable pruneable)
        {
            Ensure.ArgumentNotNull(pruneable, nameof(pruneable));

            this.caches.Add(pruneable);
            if (this.timer == null)
            {
                this.timer = new Timer((state) => this.PruneCacheIfGarbageCollectorHasRun(state), null, this.GetTimeoutInMilliseconds(), Timeout.Infinite);
            }
        }
        /// <summary>
        /// Starts pruning the specified pruneable based on the rules of the pruner.
        /// </summary>
        /// <param name="pruneable">The pruneable that will be pruned.</param>
        public void Start(IPruneable pruneable)
        {
            Ensure.ArgumentNotNull(pruneable, "pruneable");

            this.caches.Add(pruneable);
            if (this.timer == null)
            {
                this.timer = new Timer(this.PruneCacheIfGarbageCollectorHasRun, null, this.GetTimeoutInMilliseconds(), Timeout.Infinite);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Starts pruning the specified pruneable based on the rules of the pruner.
        /// </summary>
        /// <param name="pruneable">The pruneable that will be pruned.</param>
        public void Start(IPruneable pruneable)
        {
            Ensure.ArgumentNotNull(pruneable, "pruneable");

            this.caches.Add(pruneable);
            if (this.timer == null)
            {
                this.timer = new NinjectTimer(this.PruneCacheIfGarbageCollectorHasRun, this.GetTimeoutInMilliseconds());
            }
        }
        /// <summary>
        ///     Starts pruning the specified pruneable based on the rules of the pruner.
        /// </summary>
        /// <param name="pruneable">The pruneable that will be pruned.</param>
        public void Start(IPruneable pruneable)
        {
            Ensure.ArgumentNotNull(pruneable, "pruneable");

            caches.Add(pruneable);
            if (timer == null)
            {
                timer = new Timer(PruneCacheIfGarbageCollectorHasRun, null, GetTimeoutInMilliseconds(), Timeout.Infinite);
            }
        }
        /// <summary>
        /// Starts pruning the specified pruneable based on the rules of the pruner.
        /// </summary>
        /// <param name="pruneable">The pruneable that will be pruned.</param>
        public void Start(IPruneable pruneable)
        {
            this.caches.Add(pruneable);
            if (this.timer == null)
            {
#if !WINRT
                this.timer = new Timer(this.PruneCacheIfGarbageCollectorHasRun, null, this.GetTimeoutInMilliseconds(), Timeout.Infinite);
#else
                this.timer = ThreadPoolTimer.CreatePeriodicTimer(t => this.PruneCacheIfGarbageCollectorHasRun(null),
                                                                 TimeSpan.FromMilliseconds(this.GetTimeoutInMilliseconds()));
#endif
            }
        }
Exemplo n.º 7
0
 public void Start(IPruneable cache)
 {
 }