Пример #1
0
        private void CreateParser()
        {
            FileSystemParser fileSystemParser =
                new FileSystemParser(new FileSystemListener(), new List <string> {
                FolderName
            });

            _asyncFileSystemParser = new AsyncFileSystemParser(fileSystemParser, _delayIntervalInSeconds);
            _asyncFileSystemParser.ParsingFinished += HandleParsingFinished;
        }
 private void CreateParser()
 {
     FileSystemParser fileSystemParser =
         new FileSystemParser(new FileSystemListener(), new List<string> {FolderName});
     _asyncFileSystemParser = new AsyncFileSystemParser(fileSystemParser, _delayIntervalInSeconds);
     _asyncFileSystemParser.ParsingFinished += HandleParsingFinished;
 }
        private IFileSystemParser CreateParser(Settings settings)
        {
            //Don't use the same file system parser for cachedParser and AsyncFileSystemParser,
            //as AsyncFileSystemParser will operate on a different thread.
            IFileSystemParser basicParser = new FileSystemParser(new FileSystemListener());
            ICacheSerializer cacheSerializer = new CacheSerializer();
            IFileSystemParser cachedParser = new CachedFileSystemParser(basicParser,
                                                                        cacheSerializer,
                                                                        new FileSystemListener(),
                                                                        new RegistryService(),
                                                                        new AsyncFileSystemParser(new FileSystemParser(new FileSystemListener())),
                                                                        _appRunOnStartup);

            cachedParser.ExcludeFolderTemplates = settings.ExcludeFolderTemplates;
            cachedParser.FoldersToParse = settings.FoldersToParse;

            return cachedParser;
        }