コード例 #1
0
        /// <summary>
        /// See <c>IScanner</c> documentation.
        /// </summary>
        public IMultiFileScanResult Scan(IEnumerable<string> filePaths, IEnumerable<ITermTable> termTables, FileScanCompleted callback, FileContentGetter contentGetter, ScanStopper stopper)
        {
            if (filePaths == null)
            {
                throw new ArgumentNullException("filePaths");
            }
            if (termTables == null)
            {
                throw new ArgumentNullException("termTables");
            }

            MatchFinder finder = new MatchFinder(termTables);

            MultiFileScanResult allResults = new MultiFileScanResult();

            foreach (string filePath in filePaths)
            {
                if (stopper != null && stopper())
                {
                    break;
                }

                if (FileShouldBeScanned(filePath))
                {
                    IScanResult fileResult = ScanFile(filePath, finder, contentGetter, stopper);
                    allResults.Append(fileResult);
                    if (callback != null)
                    {
                        callback(fileResult);
                    }
                }
            }

            return allResults;
        }
コード例 #2
0
        /// <summary>
        /// See <c>IScanner</c> documentation.
        /// </summary>
        public IMultiFileScanResult Scan(IEnumerable <string> filePaths, IEnumerable <ITermTable> termTables, FileScanCompleted callback, FileContentGetter contentGetter, ScanStopper stopper)
        {
            if (filePaths == null)
            {
                throw new ArgumentNullException("filePaths");
            }
            if (termTables == null)
            {
                throw new ArgumentNullException("termTables");
            }

            MatchFinder finder = new MatchFinder(termTables);

            MultiFileScanResult allResults = new MultiFileScanResult();

            foreach (string filePath in filePaths)
            {
                if (stopper != null && stopper())
                {
                    break;
                }

                if (FileShouldBeScanned(filePath))
                {
                    IScanResult fileResult = ScanFile(filePath, finder, contentGetter, stopper);
                    allResults.Append(fileResult);
                    if (callback != null)
                    {
                        callback(fileResult);
                    }
                }
            }

            return(allResults);
        }
コード例 #3
0
 /// <summary>
 /// See <c>IScanner</c> documentation.
 /// </summary>
 public IMultiFileScanResult Scan(IEnumerable <string> filePaths, IEnumerable <ITermTable> termTables, FileScanCompleted callback, FileContentGetter contentGetter)
 {
     return(Scan(filePaths, termTables, callback, contentGetter, null));
 }
コード例 #4
0
 /// <summary>
 /// See <c>IScanner</c> documentation.
 /// </summary>
 public IMultiFileScanResult Scan(IEnumerable<string> filePaths, IEnumerable<ITermTable> termTables, FileScanCompleted callback, FileContentGetter contentGetter)
 {
     return Scan(filePaths, termTables, callback, contentGetter, null);
 }