예제 #1
0
        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;
                }
            }
        }
예제 #2
0
 public static void SaveConfig(Configuration config)
 {
     var s = config.Serialize();
     File.WriteAllText(config.FilePath, s);
     config.ForceSave = false;
 }
예제 #3
0
 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);
 }