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