Ejemplo n.º 1
0
        /// <summary>
        /// Adds child node.
        /// </summary>
        public VdfsEntriesTree AddChild(VdfsEntry item)
        {
            var childNode = new VdfsEntriesTree(item);

            Childrens.Add(childNode);

            return(childNode);
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }