Пример #1
0
 public override void Remove(string CacheKey)
 {
     if (objCache[CacheKey] != null)
     {
         Controller c = new Controller();
         objCache.Remove(CacheKey);
         if (Globals.WebFarmEnabled)
         {
             c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
         }
     }
 }
Пример #2
0
 public override void RemovePersistentCacheItem(string CacheKey)
 {
     if (objCache[CacheKey] != null)
     {
         objCache.Remove(CacheKey);
         if (DataCache.CachePersistenceEnabled == true)
         {
             Controller c = new Controller();
             c.DeleteCachedObject(CacheKey);
             c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
         }
     }
 }
Пример #3
0
        public override void Insert(string CacheKey, object objObject, bool PersistAppRestart)
        {
            if (PersistAppRestart)
            {
                //remove the cache key which
                //will remove the serialized
                //file before creating a new one
                Remove(CacheKey);
            }
            Controller c = new Controller();

            if (PersistAppRestart && DataCache.CachePersistenceEnabled)
            {
                c.AddCachedObject(CacheKey, objObject, Globals.ServerName);
                c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
            }
            else if (Globals.WebFarmEnabled)
            {
                c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
            }

            objCache.Insert(CacheKey, objObject);
        }
Пример #4
0
        public override void Insert(string CacheKey, object objObject, CacheDependency objDependency, DateTime AbsoluteExpiration, TimeSpan SlidingExpiration, CacheItemPriority Priority, CacheItemRemovedCallback OnRemoveCallback, bool PersistAppRestart)
        {
            if (PersistAppRestart)
            {
                //remove the cache key which
                //will remove the serialized
                //file before creating a new one
                Remove(CacheKey);
            }

            Controller c = new Controller();

            if (PersistAppRestart && DataCache.CachePersistenceEnabled)
            {
                c.AddCachedObject(CacheKey, objObject, Globals.ServerName);
                c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
            }
            else if (Globals.WebFarmEnabled)
            {
                c.AddBroadcast("RemoveCachedItem", CacheKey, Globals.ServerName);
            }

            objCache.Insert(CacheKey, objObject, objDependency, AbsoluteExpiration, SlidingExpiration, Priority, OnRemoveCallback);
        }
        public override void Insert( string CacheKey, object objObject, bool PersistAppRestart )
        {
            if( PersistAppRestart )
            {
                //remove the cache key which
                //will remove the serialized
                //file before creating a new one
                Remove( CacheKey );
            }
            Controller c = new Controller();
            if( PersistAppRestart && DataCache.CachePersistenceEnabled )
            {
                c.AddCachedObject( CacheKey, objObject, Globals.ServerName );
                c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
            }
            else if( Globals.WebFarmEnabled )
            {
                c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
            }

            objCache.Insert( CacheKey, objObject );
        }
 public override void RemovePersistentCacheItem( string CacheKey )
 {
     if( objCache[CacheKey] != null )
     {
         objCache.Remove( CacheKey );
         if( DataCache.CachePersistenceEnabled == true )
         {
             Controller c = new Controller();
             c.DeleteCachedObject( CacheKey );
             c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
         }
     }
 }
 public override void Remove( string CacheKey )
 {
     if( objCache[CacheKey] != null )
     {
         Controller c = new Controller();
         objCache.Remove( CacheKey );
         if( Globals.WebFarmEnabled )
         {
             c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
         }
     }
 }
        public override void Insert( string CacheKey, object objObject, CacheDependency objDependency, DateTime AbsoluteExpiration, TimeSpan SlidingExpiration, CacheItemPriority Priority, CacheItemRemovedCallback OnRemoveCallback, bool PersistAppRestart )
        {
            if( PersistAppRestart )
            {
                //remove the cache key which
                //will remove the serialized
                //file before creating a new one
                Remove( CacheKey );
            }

            Controller c = new Controller();
            if( PersistAppRestart && DataCache.CachePersistenceEnabled )
            {
                c.AddCachedObject( CacheKey, objObject, Globals.ServerName );
                c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
            }
            else if( Globals.WebFarmEnabled )
            {
                c.AddBroadcast( "RemoveCachedItem", CacheKey, Globals.ServerName );
            }

            objCache.Insert( CacheKey, objObject, objDependency, AbsoluteExpiration, SlidingExpiration, Priority, OnRemoveCallback );
        }