Esempio n. 1
0
        public DirectoryTree(string rootPath)
        {
            this.RootPath = rootPath;
            var root = Directory.GetParent(rootPath);

            rootFolder = new Folder(rootPath);
        }
Esempio n. 2
0
        private long GetFilesSize(Folder folder)
        {
            long size = 0;

            foreach (var file in folder.Files)
            {
                size += file.SizeInBytes;
            }

            foreach (var subFolder in folder.Folders)
            {
                size += subFolder.GetFilesSize();
            }

            return size;
        }