예제 #1
0
        public DirectoryTree(string rootPath)
        {
            this.RootPath = rootPath;
            var root = Directory.GetParent(rootPath);

            rootFolder = new Folder(rootPath);
        }
예제 #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;
        }