当前位置: 首页>>代码示例>>C#>>正文


C# CacheItemRemovedReason.ToString方法代码示例

本文整理汇总了C#中CacheItemRemovedReason.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CacheItemRemovedReason.ToString方法的具体用法?C# CacheItemRemovedReason.ToString怎么用?C# CacheItemRemovedReason.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CacheItemRemovedReason的用法示例。


在下文中一共展示了CacheItemRemovedReason.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Signal

        public void Signal(string key, object value, CacheItemRemovedReason reason)
        {
            var virtualPath = Convert.ToString(value);
            Logger.Debug("Virtual path changed ({1}) '{0}'", virtualPath, reason.ToString());

            var token = DetachToken(virtualPath);
            if (token != null)
                token.IsCurrent = false;
        }
开发者ID:gokhandisikara,项目名称:Coevery-Framework,代码行数:9,代码来源:DefaultVirtualPathMonitor.cs

示例2: ItemRemovedCallback

 internal void ItemRemovedCallback(string key, object value, CacheItemRemovedReason removedReason)
 {
     try
     {
         if (Globals.Status == Globals.UpgradeStatus.None)
         {
             // track data removed from cache to synchonize UrlRule cache
             string[] CacheKeys = UrlRuleConfiguration.GetCacheKeys();
             if (CacheKeys != null)
             {
                 foreach (string CacheKey in CacheKeys)
                 {
                     if (key.Contains(CacheKey))
                     {
                         if (DotNetNuke.Entities.Portals.PortalSettings.Current != null)
                         {
                             int PortalId = DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId;
                             Remove(GetCacheKey("UrlRuleConfig" + PortalId));
                             DnnLog.Trace("Clear cache " + key + " portal "+ PortalId + " raison "+ removedReason.ToString());
                         }
                         else
                         {
                            // DnnLog.Trace("Clear cache not executed " + key + " raison " + removedReason.ToString());
                         }
                     }
                 }
             }
             if (key.StartsWith("UrlRuleConfig"))
             {
                 DnnLog.Trace("cache " + key + "claired : " + removedReason.ToString());
             }
         }
     }
     catch (Exception exc)
     {
         //Swallow exception
         DnnLog.Error(exc);
     }
 }
开发者ID:robsiera,项目名称:OpenUrlRewriter,代码行数:39,代码来源:OpenUrlRewriterFBCachingProvider.cs

示例3: RootCacheItemRemovedCallback

        /// <summary>
        /// Called when the root cache item has been removed from the cache
        /// </summary>
        /// <param name="key">the key of the cache item that wwas removed</param>
        /// <param name="value">the value of the cache item that was removed</param>
        /// <param name="reason">The <see cref="CacheItemRemovedReason"/> for the removal of the 
        ///     item from the cache</param>
        /// <remarks>
        ///     <para>Since all cache items are dependent on the root cache item, if this method is called, 
        ///     all the cache items for this region have also been removed</para>
        /// </remarks>
        private void RootCacheItemRemovedCallback(string key, object value, CacheItemRemovedReason reason)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("Cache items for region '{0}' have been removed from the cache for the following reason : {1}",
                                 _name, reason.ToString("g"));
            }

            //lets us know that we need to reestablish the root cache item for this region
            _isRootItemCached = false;
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:22,代码来源:SysCacheRegion.cs

示例4: CacheItemRemoved

 /// <summary>
 /// Invoked when the system removes an execution chain from cache
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 /// <param name="reason">The reason.</param>
 public void CacheItemRemoved(string key, Object value, CacheItemRemovedReason reason)
 {
     WSApplication.Application.Report(Messages.ChainRemoved, key, reason.ToString());
 }
开发者ID:jijo-paulose,项目名称:bistro-framework,代码行数:10,代码来源:CachingDispatcher.cs

示例5: RemovedCallback

 public static void RemovedCallback(string k, object v, CacheItemRemovedReason r)
 {
     Log.TraceLog("★★★★★★Cache中的数据库对象被移除!★★★★★★");
     Log.TraceLog("移除的原因为:" + r.ToString());
     try
     {
         if (v != null)
         {
             if (v is IDbConnection)
             {
                 IDbConnection connection = v as IDbConnection;
                 if (connection != null)
                 {
                     connection.Close();
                     connection = null;
                     Log.TraceLog("★★★★★★数据库正常关闭!!!★★★★★★");
                 }
                 else
                 {
                     Log.TraceLog("★★★★★★数据库已经关闭!!!★★★★★★");
                 }
             }
             else
             {
                 Log.TraceLog("★★★★★★数据库已经关闭!!!★★★★★★");
             }
         }
         else
         {
             Log.TraceLog("★★★★★★不是数据库对象,无法关闭★★★★★★");
         }
     }
     catch (Exception exception)
     {
         Log.ErrorLog("★★★★★★数据库关闭发生错误!!!★★★★★★");
         Log.ErrorLog(exception.Message);
     }
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:38,代码来源:CommonUtil.cs

示例6: RemovedPageIndexCallBack

        public void RemovedPageIndexCallBack(string k, object v, CacheItemRemovedReason r)
        {
            cacheItemRemovedReason = r;
#if (DEBUG)
            if (LogRemovedReason)
            {
                var elc = new EventLogController();
                var logValue = new LogInfo { LogTypeKey = "HOST_ALERT" };

                string itemName;
                string count;
                List<string> portalCounts = null;
                switch (k)
                {
                    case "DNN_" + PageIndexKey:
                        itemName = "Page Index";
                        //user profile actions
                        try
                        {
                            DataCache.RemoveCache(UserProfileActionsKey);
                        }
                        catch (ConfigurationErrorsException)
                        {
                            //do nothing, this means the web.config file was overwritten, and thus the cache
                            //was cleared.
                        }
                        if (v != null && v.GetType() == typeof(SharedDictionary<string, string>))
                        {
                            count = "Item Count: " + ((SharedDictionary<string, string>)v).Values.Count.ToString();
                        }
                        else
                        {
                            count = "N/a";
                        }

                        break;
                    case "DNN_"  + UrlDictKey:
                        itemName = "Friendly Url List";
                        if (v != null &&
                            v.GetType() == typeof(SharedDictionary<int, SharedDictionary<string, string>>))
                        {
                            var friendlyUrls = (SharedDictionary<int, SharedDictionary<string, string>>)v;
                            portalCounts = new List<string>();
                            using (friendlyUrls.GetReadLock())
                            {
                                count = "Portal Count: " + friendlyUrls.Count.ToString();
                                foreach (int key in friendlyUrls.Keys)
                                {
                                    SharedDictionary<string, string> portalUrls = friendlyUrls[key];
                                    using (portalUrls.GetReadLock())
                                    {
                                        portalCounts.Add("Portal " + key.ToString() + " Item Count :" + portalUrls.Count.ToString());
                                    }
                                }
                            }
                        }
                        else
                        {
                            count = "N/a";
                        }
                        break;
                    default:
                        itemName = "Url Rewriter Cache Item";
                        count = "";
                        break;
                }
                //add log values
                logValue.AddProperty("Url Rewriting Caching Message", itemName + " Cache item Removed.");
                logValue.AddProperty("Reason", cacheItemRemovedReason.ToString());
                logValue.AddProperty("Cache Item Key", k);
                logValue.AddProperty("Item Count", count);
                if (portalCounts != null)
                {
                    int i = 0;
                    foreach (string item in portalCounts)
                    {
                        logValue.AddProperty("Item " + i.ToString(), item);
                        i++;
                    }
                }
                //System.Diagnostics.Trace.Assert(k != null, "k == " + k);
                elc.AddLog(logValue);
            }
#endif
        }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:85,代码来源:CacheController.cs

示例7: CacheOnRemove

 /// <summary>
 /// ����ʧЧ�ص�ί�е�һ��ʵ��,�Ժ�������־��¼
 /// </summary>
 /// <param name="key"></param>
 /// <param name="val"></param>
 /// <param name="reason"></param>
 public void CacheOnRemove(string Key, object Val, CacheItemRemovedReason Reason)
 {
     //switch (Reason)
     //{
     //    case CacheItemRemovedReason.DependencyChanged:
     //        break;
     //    case CacheItemRemovedReason.Expired:
     //        {
     //            break;
     //        }
     //    case CacheItemRemovedReason.Removed:
     //        {
     //            break;
     //        }
     //    case CacheItemRemovedReason.Underused:
     //        {
     //            break;
     //        }
     //    default: break;
     //}
     //����Ҫʹ�û�����־,����Ҫʹ���������
     //myLogVisitor.WriteLog(this,key,val,reason);
     if (this._IsWriteLogs)
     {
         string logfilepath = Common.Utils.GetMapPath(string.Format("~\\LiteCMSLogs\\{0}.txt", DateTime.Now.ToString("yyMMdd")));
         Val = Val == null ? "" : Val.ToString();
         string message = string.Format("Key:{0},Value:{1},Reason:{2}", Key, Val, Reason.ToString());
         Logs.TinyLogs.InsertLog(logfilepath, DateTime.Now, "Cache_Removed", message);
     }
 }
开发者ID:wenysky,项目名称:deepinsummer,代码行数:36,代码来源:TinyCache.cs

示例8: Signal

        private void Signal(object value, CacheItemRemovedReason reason)
        {
            var virtualPath = Convert.ToString(value);
            Logger.Debug("虚拟路径发生了变更 ({1}) '{0}'", virtualPath, reason.ToString());

            var token = DetachToken(virtualPath);
            if (token != null)
                token.IsCurrent = false;
        }
开发者ID:l1183479157,项目名称:RabbitHub,代码行数:9,代码来源:DefaultVirtualPathMonitor.cs

示例9: LogRemovedItemToAzure

 public static void LogRemovedItemToAzure(String key, Object o, CacheItemRemovedReason r)
 {
     GenUtils.LogMsg("info", "LogRemovedItemToAzure: " + key, r.ToString());
 }
开发者ID:jalbertbowden,项目名称:elmcity,代码行数:4,代码来源:CacheUtils.cs

示例10: LogRemovedItemToConsole

 public static void LogRemovedItemToConsole(String key, Object o, CacheItemRemovedReason r)
 {
     Console.WriteLine("info: " + key + " " + r.ToString());
 }
开发者ID:jalbertbowden,项目名称:elmcity,代码行数:4,代码来源:CacheUtils.cs

示例11: Refresh

 public void Refresh(string key, object expiredValue, CacheItemRemovedReason removalReason)
 {
     expiredKeys += key;
     expiredValues += expiredValue;
     removalReasons += removalReason.ToString();
 }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:6,代码来源:CacheFeatureTestFixture.cs

示例12: CacheExpiredEventArgs

 /// <summary>
 /// Construct cache expire event argument.
 /// </summary>
 /// <param name="cacheKey">caching key</param>
 /// <param name="cacheValue">caching value</param>
 /// <param name="reason">cached object removed reason</param>
 internal CacheExpiredEventArgs(object cacheKey, object cacheValue, CacheItemRemovedReason reason)
 {
     this.Key = cacheKey;
     this.Value = cacheKey;
     this.Reason = (CacheRemovedReason)Enum.Parse(typeof(CacheRemovedReason), reason.ToString());
 }
开发者ID:TatumAndBell,项目名称:RapidWebDev-Enterprise-CMS,代码行数:12,代码来源:CacheExpiredEventArgs.cs

示例13: RemovedCallBack

 private void RemovedCallBack(string k, object v, CacheItemRemovedReason r)
 {
     Logger.Info(k + " : " + r.ToString() + "/" + Environment.StackTrace);
 }
开发者ID:sachatrauwaen,项目名称:OpenUrlRewriter,代码行数:4,代码来源:CacheController.cs

示例14: CachedItemRemovedCallback

 private void CachedItemRemovedCallback(string key, Object val,
     CacheItemRemovedReason reason)
 {
     //
     if (reason == CacheItemRemovedReason.DependencyChanged)
     {
         // Log the cache key name, reason and time details
         // when the cached object was removed from the cache
     }
     Logger.Debug("Removed item from cache - " + key + " at " + DateTime.Now.ToString() + ". Reason - " + reason.ToString());
 }
开发者ID:protechdm,项目名称:TMD,代码行数:11,代码来源:Caching.cs

示例15: SearchCacheItemRemoved

 public void SearchCacheItemRemoved(string key, object value, CacheItemRemovedReason reason)
 {
     LogManager.CurrentLog.AddEntry("Item removed from web cache:\r\n KEY: {0}\r\nREASON: {1}", LogEventType.Information, key, reason.ToString());
 }
开发者ID:BryanApellanes,项目名称:Naizari,代码行数:4,代码来源:AutoCompleteSearcherBase.cs


注:本文中的CacheItemRemovedReason.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。