本文整理汇总了C#中CacheType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CacheType.ToString方法的具体用法?C# CacheType.ToString怎么用?C# CacheType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheType
的用法示例。
在下文中一共展示了CacheType.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetItem
/// <summary>
///
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public static Object GetItem(CacheType type)
{
switch (type)
{
case CacheType.TopCatalog:
if (QJVRMSCache.Get(type.ToString()) == null)
{
QJVRMSCache.Insert(type.ToString(), Catalog.GetTopCatalog());
}
break;
case CacheType.AllCatalog:
if (QJVRMSCache.Get(type.ToString()) == null)
{
QJVRMSCache.Insert(type.ToString(), Catalog.GetAllCatalog());
}
break;
case CacheType.Feature:
break;
case CacheType.ResouceType:
if (QJVRMSCache.Get(type.ToString()) == null)
{
QJVRMSCache.Insert(type.ToString(), ResourceTypeManager.GetTypeList());
}
break;
default:
break;
}
return QJVRMSCache.Get(type.ToString());
}
示例2: GetCache
private ICache<int, int> GetCache(CacheType cacheType, int capacity)
{
switch (cacheType)
{
case CacheType.LRU_ThreadSafe:
return CacheBuilder.LRU_ThreadSafe<int, int>(capacity);
case CacheType.LRU_Non_ThreadSafe:
return CacheBuilder.LRU_NonThreadSafe<int, int>(capacity);
case CacheType.MRU_ThreadSafe:
return CacheBuilder.MRU_ThreadSafe<int, int>(capacity);
case CacheType.MRU_Non_ThreadSafe:
return CacheBuilder.MRU_NonThreadSafe<int, int>(capacity);
default:
throw new NotSupportedException(cacheType.ToString());
}
}