コード例 #1
0
        public DirectoryStructure Crawl(MetaUtil metaUtil, string startPath, string path)
        {
            var pathSet = _path.GetPaths(path);

            var(filePropsDictionary, directoryProps) = GetProps(startPath, path);
            IEnumerable <FileStructure> files = _path.GetFiles(pathSet.RelativePath)
                                                .Where(o => o.Name != _dirrcFileName)
                                                .Select(o => new FileStructure(o, filePropsDictionary.GetValueOrDefault(o.Name)));
            IEnumerable <DirectoryStructure> directories = null;

            if (!directoryProps.Terminate)
            {
                directories = _path.GetDirectories(pathSet.RelativePath).Select(s => this.Crawl(null, startPath, s.RelativePath));
            }
            return(new DirectoryStructure(pathSet, files, directories, directoryProps));
        }
コード例 #2
0
 public MetaUtil(string path, MetaUtil parent, params Meta[] metas)
     : this(System.IO.Path.Combine(parent.Path, path), parent.Metas.Concat(metas).ToArray())
 {
 }