/// <summary> /// 返回配置类实例 /// </summary> /// <returns></returns> public static ScheduleConfigInfo LoadConfig() { try { ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true); } catch { if (!File.Exists(ConfigFilePath)) { ScriptEventConfigFileManager secf = new ScriptEventConfigFileManager(); secf.SaveConfig(ConfigFilePath, ConfigInfo); } } return(ConfigInfo as ScheduleConfigInfo); }
/// <summary> /// 初始化文件修改时间和对象实例 /// </summary> static GeneralConfigFileManager() { m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath); try { m_configinfo = (GeneralConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(GeneralConfigInfo)); } catch { if (File.Exists(ConfigFilePath)) { m_configinfo = (GeneralConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(GeneralConfigInfo)); } } }
/// <summary> /// 初始化文件修改时间和对象实例 /// </summary> static ScheduleConfigFileManager() { m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath); m_configinfo = (ScheduleConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(ScheduleConfigInfo)); }