Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public object this[object key]
 {
     get
     {
         _keyList.Remove(key);
         _keyList.Add(key);
         return(_mc.Get(key.ToString()));
     }
     set
     {
         _keyList.Add(key);
         if (_keyList.Count > _cacheSize)
         {
             object oldestKey = _keyList[0];
             _keyList.Remove(0);
             _mc.Delete(oldestKey.ToString());
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 按照key删除对象
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool Delete(string key)
 {
     return(mc.Delete(key));
 }