本文整理汇总了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())
{
}
示例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();
}
示例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);
}
}
}