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


C# CacheItemPriority.ToString方法代码示例

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


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

示例1: RedisCacheEntry

 public RedisCacheEntry(String key,
     Object value,
     DateTimeOffset absoluteExpiration,
     TimeSpan slidingExpiration,
     CacheItemPriority priority)
     : this(key, value, absoluteExpiration, slidingExpiration, priority.ToString())
 {
 }
开发者ID:cityindex,项目名称:Redis-Object-Cache,代码行数:8,代码来源:RedisCacheEntry.cs

示例2: RedisCacheEntryState

        internal RedisCacheEntryState(DateTimeOffset absExp,
                                  TimeSpan slidingExp,
                                  CacheItemPriority priority,
                                  string typeName)
        {
            AbsoluteExpiration = absExp;
            SlidingExpiration = slidingExp;
            Priority = priority.ToString();
            TypeName = typeName;

            UtcCreated = DateTime.UtcNow;

            UpdateUsage();
        }
开发者ID:braegelno5,项目名称:Redis-Object-Cache,代码行数:14,代码来源:RedisCacheEntryState.cs

示例3: Configure

        /// <summary>
        /// Configures the cache region from configuration values
        /// </summary>
        /// <param name="settings">Configuration settings for the region</param>
        /// <param name="additionalProperties">The additional properties supplied by NHibernate engine</param>
        private void Configure(CacheRegionElement settings, IDictionary<string, string> additionalProperties)
        {
            log.Debug("Configuring cache region");

            //these are some default conenction values that can be later used by the data dependencies
            //if no custome settings are specified
            string connectionName = null;
            string connectionString = null;

            if (additionalProperties != null)
            {
                //pick up connection settings that might be used later for data dependencis if any are specified
                if (additionalProperties.ContainsKey(Environment.ConnectionStringName))
                {
                    connectionName = additionalProperties[Environment.ConnectionStringName];
                }

                if (additionalProperties.ContainsKey(Environment.ConnectionString))
                {
                    connectionString = additionalProperties[Environment.ConnectionString];
                }
            }

            if (settings != null)
            {
                _priority = settings.Priority;
                _timeOfDayExpiration = settings.TimeOfDayExpiration;
                _relativeExpiration = settings.RelativeExpiration;

                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("using priority: {0}", settings.Priority.ToString("g"));

                    if (_relativeExpiration.HasValue)
                    {
                        log.DebugFormat("using relative expiration :{0}", _relativeExpiration);
                    }

                    if (_timeOfDayExpiration.HasValue)
                    {
                        log.DebugFormat("using time of day expiration : {0}", _timeOfDayExpiration);
                    }
                }

                CreateDependencyEnlisters(settings.Dependencies, connectionName, connectionString);
            }
            else
            {
                _priority = CacheItemPriority.Default;

                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("no priority specified using default : {0}", _priority.ToString("g"));
                }
            }

            //use the default expiration of no expiration was set
            if (_relativeExpiration.HasValue == false && _timeOfDayExpiration.HasValue == false)
            {
                _relativeExpiration = defaultRelativeExpiration;

                if (log.IsDebugEnabled)
                {
                    log.DebugFormat("no expiration specified using default : {0}", _relativeExpiration);
                }
            }
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:72,代码来源:SysCacheRegion.cs


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