コード例 #1
0
ファイル: Global.asax.cs プロジェクト: shhyder/application
        public static void RefreshData(String key, Object item,
                CacheItemRemovedReason reason)
        {

          
            try
            {
                
               

                lock (_cache)
                {
                    BusinessLogic.Parameter.Parameter par = new BusinessLogic.Parameter.Parameter();
                    DataSet.DSParameter ds = par.GetParamerter();
                    System.TimeSpan span = new TimeSpan(0, 0, 30, 20, 0);


                    //if( ds != null )
                    //    _cache["data"] = ds;
                    
                    
                    _cache.Insert("data", ds, null,
                        Cache.NoAbsoluteExpiration, span,
                        CacheItemPriority.High,
                        new CacheItemRemovedCallback(RefreshData));
                }
            }
            catch
            {

            }

        }
コード例 #2
0
ファイル: Global.asax.cs プロジェクト: shhyder/application
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);


            _cache = Context.Cache;

            BusinessLogic.Parameter.Parameter par = new BusinessLogic.Parameter.Parameter();
            DataSet.DSParameter ds = par.GetParamerter();


            System.TimeSpan span = new TimeSpan(0, 0, 2, 20, 0);

            _cache.Insert("data", ds, null,
          Cache.NoAbsoluteExpiration, span,
          CacheItemPriority.Default,
          new CacheItemRemovedCallback(RefreshData));
        }
コード例 #3
0
        protected void UpdateCache()
        {
            BusinessLogic.Parameter.Parameter par = new BusinessLogic.Parameter.Parameter();
            DataSet.DSParameter ds = par.GetParamerter();


            if (ds != null)
            {
                lock ( MvcApplication._cache )
                {
                    MvcApplication._cache["data"] = ds;
                }

            }

        }