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