/// <summary> /// Adds child node. /// </summary> public VdfsEntriesTree AddChild(VdfsEntry item) { var childNode = new VdfsEntriesTree(item); Childrens.Add(childNode); return(childNode); }
private void saveFiles(VdfsEntriesTree tree, string outputDirectory) { Directory.CreateDirectory(outputDirectory); for (int i = 0; i < tree.Childrens.Count; i++) { var output = Path.Combine(outputDirectory, tree.Childrens[i].Entry.Name); if (tree.Childrens[i].Entry.Type.HasFlag(Vdfs.EntryType.Directory)) { saveFiles(tree.Childrens[i], output); } else { tree.Childrens[i].Entry.SaveToFile(output); } } }