// 可反复调用 public static void SaveConfig() { #if NO // Save the configuration file. if (_config != null) { _config.Save(); _config = null; } #endif // Save the configuration file. if (_config != null && _config.Changed == true) { _config.Save(); } }
public bool Finish() { string strError = ""; if (string.IsNullOrEmpty(this.DataDir)) { strError = "this.DataDir 不应为空"; goto ERROR1; } // Save the configuration file. if (_config != null) { _config.Set("default", "data_dir", this.DataDir); _config.Save(); _config = null; } // 删除备份数据目录 if (string.IsNullOrEmpty(this.ShadowDataDir) == false) { PathUtil.DeleteDirectory(this.ShadowDataDir); } return(true); ERROR1: MessageBox.Show(this, strError); return(false); }
// 允许反复调用 public static void SaveConfig() { // Save the configuration file. if (_config != null && _config.Changed) { _config.Save(); } }
protected static void SaveNodeAction(IConfigurationNode node) { ConfigSetting cs = node.ConfigObj as ConfigSetting; if (cs != null) { cs.Save(); } }
public static void SaveConfig() { // Save the configuration file. if (_config != null) { _config.Save(); _config = null; } }
// 允许反复调用 public static void SaveConfig(delegate_fileCreated func_fileCreated) { // Save the configuration file. if (_config != null && _config.Changed) { bool exists = string.IsNullOrEmpty(_config.FileName) == false && File.Exists(_config.FileName); _config.Save(); // 首次创建文件 if (exists == false && string.IsNullOrEmpty(_config.FileName) == false && File.Exists(_config.FileName)) { func_fileCreated?.Invoke(_config.FileName); } } }
/// <summary> /// Saves the associated config setting. /// </summary> public void Save() { UpdateSetting(); _setting.Save(); }