// 允许反复调用 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); } } }
public static void Finish(delegate_fileCreated func_fileCreated) { SaveConfig(func_fileCreated); }