public void MergeValues(Configuration configuration) { ChildConfigurations.Add(configuration); foreach (var argParam in configuration.Parameters.Where(p => p.Value != null)) { var param = Parameters.FirstOrDefault(p => p.Name == argParam.Name); if (param != null) { param.Value = argParam.Value; if (argParam.Encrypted != EncryptionOptions.NotSet) param.Encrypted = argParam.Encrypted; param.ValueComesFromConfiguration = configuration; } } }
public static void SaveConfig(Configuration config) { var s = config.Serialize(); File.WriteAllText(config.FilePath, s); config.ForceSave = false; }
private string GetParentConfigPath(Configuration currentConfiguration) { var path = currentConfiguration.Parent; if (Path.IsPathRooted(path) || path.IsNullOrEmpty()) return path; var dir = Path.GetDirectoryName(currentConfiguration.FilePath); return Path.Combine(dir, path); }