private void CreateConfigTree(DirectoryInfo directoryInfo, ConfigsMerger merger) { foreach (DirectoryInfo info in directoryInfo.GetDirectories()) { string path = this.GetPath(info.FullName); this.root.FindOrCreateNode(path); this.CreateConfigTree(info, merger); } foreach (FileInfo info2 in directoryInfo.GetFiles()) { if (this.configurationProfile.Match(info2.Name)) { string path = this.GetPath(directoryInfo.FullName); ConfigTreeNode configTreeNode = this.root.FindOrCreateNode(path); try { YamlNodeImpl yamlNode = YamlService.Load(info2); merger.Put(configTreeNode, info2.Name, yamlNode); } catch (Exception exception1) { throw new Exception(path, exception1); } } } }
public void Put(ConfigTreeNode configTreeNode, string configName, YamlNodeImpl yamlNode) { List <ConfigData> list; ConfigData item = new ConfigData(configName, yamlNode); if (this.configNodeToConfigDataList.ContainsKey(configTreeNode)) { list = this.configNodeToConfigDataList[configTreeNode]; } else { list = new List <ConfigData>(); this.configNodeToConfigDataList[configTreeNode] = list; } list.Add(item); }
public ConfigData(string configName, YamlNodeImpl yamlNode) { this.yamlNode = yamlNode; char[] separator = new char[] { '_' }; this.profileElements = configName.Split(separator).Length - 1; }