namespace BP.GPM.DTalk.DDSDK { /// /// 缓存项 /// public class CacheItem { #region 属性 private object _value; public object Value { get { return _value; } set { _value = value; } } private string _key; public string Key { get { return _key; } set { _key = value; } } #endregion #region 内部变量 /// /// 插入时间 /// private long _insertTime; /// /// 过期时间 /// private int _expire; #endregion #region 构造函数 /// /// 构造函数 /// /// 缓存的KEY /// 缓存的VALUE /// 缓存的过期时间 public CacheItem(string key, object value, int expire) { this._key = key; this._value = value; this._expire = expire; this._insertTime = TimeStamp.Now(); } #endregion #region Expired /// /// 是否过期 /// /// public bool Expired() { return TimeStamp.Now() > this._insertTime + _expire; } #endregion } }