/// <summary> /// 过期检查 /// </summary> /// <returns></returns> public virtual bool IsConfigsExpired() { DateTime dtNewWriteTime = AqiConfig.ReadWriteTimeFormJson(this); if (dtNewWriteTime > this.dtConfigCacheTime) { return(true); } return(false); }
/// <summary> /// 加载配置 /// </summary> /// <returns></returns> public virtual bool LoadConfigs() { try { thisLock.EnterWriteLock(); List <AqiConfig> list = AqiConfig.CreateListFormJson(this); this.allConfig = list.ToDictionary <AqiConfig, string>(ac => ac.Name); this.dtConfigCacheTime = AqiConfig.ReadWriteTimeFormJson(this); } catch (System.Exception e) { throw e; } finally { thisLock.ExitWriteLock(); } return(true); }