Exemplo n.º 1
0
        public static IEnumerable <SearchedFile> FindAll(ISearchStrategy strategy, SearchLocation location, IProgressMonitor progressMonitor)
        {
            currentSearchRegion = null;
            SearchableFileContentFinder fileFinder = new SearchableFileContentFinder();

            return(new SearchRun(strategy, fileFinder, location.GenerateFileList(), progressMonitor)
            {
                Target = location.Target, Selection = location.Selection
            }.GetResults());
        }
Exemplo n.º 2
0
        public static SearchResultMatch FindNext(ISearchStrategy strategy, SearchLocation location)
        {
            var files = location.GenerateFileList().ToArray();

            if (files.Length == 0)
            {
                return(null);
            }
            if (currentSearchRegion == null || !currentSearchRegion.IsSameState(files, strategy, location))
            {
                currentSearchRegion = SearchRegion.CreateSearchRegion(files, strategy, location);
            }
            if (currentSearchRegion == null)
            {
                return(null);
            }
            var result = currentSearchRegion.FindNext();

            if (result == null)
            {
                currentSearchRegion = null;
            }
            return(result);
        }