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); } } } }
private YamlNodeImpl LoadYaml(IReader reader) { YamlNodeImpl impl; using (EntryStream stream = reader.OpenEntryStream()) { using (MemoryStream stream2 = new MemoryStream()) { this.TransferTo(stream, stream2); stream2.Seek(0L, SeekOrigin.Begin); using (StreamReader reader2 = new StreamReader(stream2)) { impl = YamlService.Load(reader2); } } } return(impl); }