예제 #1
0
        /// <summary>
        /// 保存配置实例
        /// </summary>
        /// <param name="baseconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(CacheConfigInfo cacheConfiginfo)
        {
            CacheConfigFileManager acfm = new CacheConfigFileManager();

            CacheConfigFileManager.ConfigInfo = cacheConfiginfo;
            return(acfm.SaveConfig());
        }
예제 #2
0
 /// <summary>
 /// 静态构造函数初始化相应实例和定时器
 /// </summary>
 static CacheConfig()
 {
     m_configinfo = CacheConfigFileManager.LoadConfig();
     baseConfigTimer.AutoReset = true;
     baseConfigTimer.Enabled   = true;
     baseConfigTimer.Elapsed  += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
     baseConfigTimer.Start();
 }
예제 #3
0
 /// <summary>
 /// 静态构造函数初始化相应实例和定时器
 /// </summary>
 static CacheConfig()
 {
     m_configinfo = CacheConfigFileManager.LoadConfig();
     baseConfigTimer.AutoReset = true;
     baseConfigTimer.Enabled = true;
     baseConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
     baseConfigTimer.Start();
 }
예제 #4
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetRealConfig()
 {
     m_configinfo = CacheConfigFileManager.LoadRealConfig();
 }
예제 #5
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static CacheConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo = (CacheConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(CacheConfigInfo));
 }
예제 #6
0
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static CacheConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo    = (CacheConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(CacheConfigInfo));
 }
예제 #7
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetRealConfig()
 {
     m_configinfo = CacheConfigFileManager.LoadRealConfig();
 }
예제 #8
0
 /// <summary>
 /// 保存配置实例
 /// </summary>
 /// <param name="baseconfiginfo"></param>
 /// <returns></returns>
 public static bool SaveConfig(CacheConfigInfo cacheConfiginfo)
 {
     CacheConfigFileManager acfm = new CacheConfigFileManager();
     CacheConfigFileManager.ConfigInfo = cacheConfiginfo;
     return acfm.SaveConfig();
 }