コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #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 );
        }