Ejemplo n.º 1
0
        public FileSystemCompletionHelper(
            ICompletionProvider completionProvider,
            TextSpan textChangeSpan,
            ICurrentWorkingDirectoryDiscoveryService fileSystemDiscoveryService,
            Glyph folderGlyph,
            Glyph fileGlyph,
            ImmutableArray <string> searchPaths,
            IEnumerable <string> allowableExtensions,
            Func <string, bool> exclude = null)
        {
            Debug.Assert(searchPaths.All(path => PathUtilities.IsAbsolute(path)));

            this.completionProvider         = completionProvider;
            this.textChangeSpan             = textChangeSpan;
            this.searchPaths                = searchPaths;
            this.allowableExtensions        = allowableExtensions.Select(e => e.ToLowerInvariant()).ToSet();
            this.fileSystemDiscoveryService = fileSystemDiscoveryService;
            this.folderGlyph                = folderGlyph;
            this.fileGlyph = fileGlyph;
            this.exclude   = exclude;

            this.lazyGetDrives = new Lazy <string[]>(() =>
                                                     IOUtilities.PerformIO(Directory.GetLogicalDrives, SpecializedCollections.EmptyArray <string>()));
        }
Ejemplo n.º 2
0
 private static FileSystemInfo[] GetFileSystemInfos(DirectoryInfo directoryInfo)
 {
     return(IOUtilities.PerformIO(directoryInfo.GetFileSystemInfos, SpecializedCollections.EmptyArray <FileSystemInfo>()));
 }
Ejemplo n.º 3
0
 private static bool IsDriveRoot(string fullPath)
 {
     return(IOUtilities.PerformIO(() => new DirectoryInfo(fullPath).Parent == null));
 }