Beispiel #1
0
        public void ClearService()
        {
            if (fileSearchService != null)
            {
                fileSearchService.Dispose();
            }

            fileSearchService = null;
        }
        private IFileSearchService CreateFileSearchService()
        {
            if (fileSearchService == null || directoryPath != Settings.Default.SourceDirectoryPath)
            {
                directoryPath     = Settings.Default.SourceDirectoryPath;
                fileSearchService = new FileSystemWatcherSearchService(directoryPath, pinStateService);
            }

            return(fileSearchService);
        }
Beispiel #3
0
        private IFileSearchService CreateFileSearchService(IBackgroundContext backgroundContext)
        {
            if (fileSearchService == null || directoryPath != settings.SourceDirectoryPath)
            {
                ClearService();

                if (directoryPath != null)
                {
                    FileSystemWatcherSearchService.ClearCache();
                }

                directoryPath     = settings.SourceDirectoryPath;
                fileSearchService = new FileSystemWatcherSearchService(directoryPath, pinStateService, backgroundContext, logFactory, exceptionHandler);
            }

            return(fileSearchService);
        }
 public void ClearService()
 {
     fileSearchService = null;
 }