Ejemplo n.º 1
0
        private void OnCreated(object source, FileSystemEventArgs e)
        {
            LoggerService.WriteLog(string.Format("Novo arquivo encontrado. Arquivo: {0}", e.FullPath), LoggerService.LogType.info);
            FileImporterService fileReader = new FileImporterService(_fileImporterConfiguration);

            fileReader.ProcessFile(e.FullPath);
        }
Ejemplo n.º 2
0
        private void processAllPendingFiles()
        {
            try
            {
                LoggerService.WriteLog(string.Format("Iniciando leitura do diretório {0}", _fileImporterConfiguration.inputDir), LoggerService.LogType.info);
                string[] directoryFiles = Directory.GetFiles(_fileImporterConfiguration.inputDir);

                FileImporterService fileImporterService = new FileImporterService(_fileImporterConfiguration);
                foreach (string fullFileName in directoryFiles)
                {
                    fileImporterService.ProcessFile(fullFileName);
                }
            }
            catch (Exception ex)
            {
                LoggerService.WriteLog("Ocorreu um erro durante a leitura do dretório de entrada.", LoggerService.LogType.error, ex);
            }
        }