private IDictionary <string, FileObject> MapCache() { if (_mapCache == null) { _mapCache = _file.Visit(); } return(_mapCache); }
private static Glob.FileSystemEnumerator CreateEnumerator(FileObject file) { var map = file.Visit(); Glob.FileSystemEnumerator e = (entityType, path) => { FileObject result; if (!map.TryGetValue(path, out result)) result = FileObject.Empty; IEnumerable<Tuple<string, Glob.FileSystemEntity>> items = result.Files.Select(t => t.AsTuple()); if (entityType != Glob.FileSystemEntity.FileOrDirectory) items = items.Where(t => t.Item2 == entityType); return items; }; return e; }