defaultcachestrategy.cs

来自「基于C/S的医疗卫生管理系统」· CS 代码 · 共 48 行

CS
48
字号
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 + =
减小字号Ctrl + -
显示快捷键?