/// <summary> /// 保存配置类实例 /// </summary> /// <param name="generalconfiginfo"></param> /// <returns></returns> public static bool SaveConfig(GeneralConfigInfo generalconfiginfo) { GeneralConfigFileManager gcf = new GeneralConfigFileManager(); GeneralConfigFileManager.ConfigInfo = generalconfiginfo; return(gcf.SaveConfig()); }
/// <summary> /// 返回配置类实例 /// </summary> /// <returns></returns> public static GeneralConfigInfo LoadConfig() { try { if (!File.Exists(ConfigFilePath)) { GeneralConfigFileManager secf = new GeneralConfigFileManager(); ConfigInfo = new GeneralConfigInfo(); secf.SaveConfig(ConfigFilePath, ConfigInfo); } else { ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true); } } catch { if (!File.Exists(ConfigFilePath)) { GeneralConfigFileManager secf = new GeneralConfigFileManager(); secf.SaveConfig(ConfigFilePath, ConfigInfo); } } return(ConfigInfo as GeneralConfigInfo); }
/// <summary> /// 保存配置类实例 /// </summary> /// <param name="generalconfiginfo"></param> /// <returns></returns> public static bool SaveConfig(GeneralConfigInfo generalconfiginfo) { GeneralConfigFileManager gcf = new GeneralConfigFileManager(); GeneralConfigFileManager.ConfigInfo = generalconfiginfo; return gcf.SaveConfig(); }
/// <summary> /// 返回配置类实例 /// </summary> /// <returns></returns> public static GeneralConfigInfo LoadConfig() { try { if (!File.Exists(ConfigFilePath)) { GeneralConfigFileManager secf = new GeneralConfigFileManager(); ConfigInfo = new GeneralConfigInfo(); secf.SaveConfig(ConfigFilePath, ConfigInfo); } else { ConfigInfo = DefaultConfigFileManager.LoadConfig(ref m_fileoldchange, ConfigFilePath, ConfigInfo, true); } } catch { if (!File.Exists(ConfigFilePath)) { GeneralConfigFileManager secf = new GeneralConfigFileManager(); secf.SaveConfig(ConfigFilePath, ConfigInfo); } } return ConfigInfo as GeneralConfigInfo; }