/// <summary> /// 保存配置类实例 /// </summary> /// <param name="emailconfiginfo"></param> /// <returns></returns> public static bool SaveConfig(MemCachedConfigInfo configinfo) { MemCachedConfigFileManager mccfm = new MemCachedConfigFileManager(); MemCachedConfigFileManager.ConfigInfo = configinfo; return(mccfm.SaveConfig()); }
static MemCachedConfigs() { m_configinfo = MemCachedConfigFileManager.LoadConfig(); memCachedConfigTimer.AutoReset = true; memCachedConfigTimer.Enabled = true; memCachedConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed); memCachedConfigTimer.Start(); }
/// <summary> /// 初始化文件修改时间和对象实例 /// </summary> static MemCachedConfigFileManager() { if (System.IO.File.Exists(ConfigFilePath)) { m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath); m_configinfo = (MemCachedConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(MemCachedConfigInfo)); } }
/// <summary> /// 重设配置类实例 /// </summary> public static void ResetConfig() { m_configinfo = MemCachedConfigFileManager.LoadConfig(); }