예제 #1
0
        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="emailconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(MemCachedConfigInfo configinfo)
        {
            MemCachedConfigFileManager mccfm = new MemCachedConfigFileManager();

            MemCachedConfigFileManager.ConfigInfo = configinfo;
            return(mccfm.SaveConfig());
        }
예제 #2
0
 static MemCachedConfigs()
 {
     m_configinfo = MemCachedConfigFileManager.LoadConfig();
     memCachedConfigTimer.AutoReset = true;
     memCachedConfigTimer.Enabled   = true;
     memCachedConfigTimer.Elapsed  += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
     memCachedConfigTimer.Start();
 }
예제 #3
0
 /// <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));
     }
 }
예제 #4
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = MemCachedConfigFileManager.LoadConfig();
 }