📄 defaultcachestrategy.cs
字号:
using System;
using System.Collections;
namespace Qeb.Support.Cache
{
public class DefaultCacheStrategy : ICacheStrategy
{
private Hashtable m_ObjectTable;
/// <summary>
/// constructor to instantiate the internal hashtable.
/// </summary>
public DefaultCacheStrategy()
{
m_ObjectTable = new Hashtable();
}
/// <summary>
/// Add an object to the underlying storage
/// </summary>
/// <param name="objId">key for the object</param>
/// <param name="o">object</param>
public void AddObject(string objId, object o)
{
m_ObjectTable.Add(objId, o);
}
/// <summary>
/// Remove an object from the underlying storage
/// </summary>
/// <param name="objId">key for the object</param>
public void RemoveObject(string objId)
{
m_ObjectTable.Remove(objId);
}
/// <summary>
/// Retrieve an object from the underlying storage
/// </summary>
/// <param name="objId">key for the object</param>
/// <returns>object</returns>
public object RetrieveObject(string objId)
{
return m_ObjectTable[objId];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -