コード例 #1
0
        /// <summary>
        /// <para>Invoker for the <see cref="ItemRemoved"/> event.</para>
        /// </summary>
        /// <param name="identity">
        /// A <see cref="IIdentity"/>
        /// </param>
        protected virtual void OnItemRemoved(IIdentity identity)
        {
            CachingEventArgs args = new CachingEventArgs(CachingEventType.ItemRemoved);

            args.EntityIdentity = identity;

            if (this.ItemRemoved != null)
            {
                this.ItemRemoved(this, args);
            }
        }
コード例 #2
0
        /// <summary>
        /// <para>Invoker for the <see cref="CacheMiss"/> event.</para>
        /// </summary>
        /// <param name="identity">
        /// A <see cref="IIdentity"/>
        /// </param>
        protected virtual void OnCacheMiss(IIdentity identity)
        {
            CachingEventArgs args = new CachingEventArgs(CachingEventType.CacheMiss);

            args.EntityIdentity = identity;

            if (this.CacheMiss != null)
            {
                this.CacheMiss(this, args);
            }
        }
コード例 #3
0
        /// <summary>
        /// <para>Event handler for the addition of new items to this cache instance.</para>
        /// </summary>
        /// <param name="sender">
        /// A <see cref="System.Object"/>
        /// </param>
        /// <param name="ev">
        /// A <see cref="EventArgs"/>
        /// </param>
        private void HandleItemAdded(object sender, EventArgs ev)
        {
            CachingEventArgs args = ev as CachingEventArgs;

            if (Object.ReferenceEquals(sender, this) &&
                args != null &&
                args.EventType == CachingEventType.ItemAdded &&
                this.EntityThresholdExceeded())
            {
                this.LockedCleanup();
            }
        }
コード例 #4
0
 /// <summary>
 /// <para>Invoker for the <see cref="ItemRemoved"/> event.</para>
 /// </summary>
 /// <param name="identity">
 /// A <see cref="IIdentity"/>
 /// </param>
 protected virtual void OnItemRemoved(IIdentity identity)
 {
   CachingEventArgs args = new CachingEventArgs(CachingEventType.ItemRemoved);
   args.EntityIdentity = identity;
   
   if(this.ItemRemoved != null)
   {
     this.ItemRemoved(this, args);
   }
 }
コード例 #5
0
 /// <summary>
 /// <para>Invoker for the <see cref="CacheMiss"/> event.</para>
 /// </summary>
 /// <param name="identity">
 /// A <see cref="IIdentity"/>
 /// </param>
 protected virtual void OnCacheMiss(IIdentity identity)
 {
   CachingEventArgs args = new CachingEventArgs(CachingEventType.CacheMiss);
   args.EntityIdentity = identity;
   
   if(this.CacheMiss != null)
   {
     this.CacheMiss(this, args);
   }
 }