/// <summary> /// Constructor. /// </summary> public CsvFileRepository( IConfigReader config, IFileSystemFacade fileSystemFacade) { _configReader = config; _fileSystemFacade = fileSystemFacade; _logger = LogManager.GetCurrentClassLogger(); BaseDirectory = _configReader.Settings.WorkingDirectoryBase; if (string.IsNullOrWhiteSpace(BaseDirectory) || string.Equals(BaseDirectory.ToLower(), "desktop")) { BaseDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); } WorkingDirectory = Path.Combine(BaseDirectory, _configReader.Settings.WorkingDirectory); BackupDirectory = Path.Combine(WorkingDirectory, _configReader.Settings.BackupDirectory); _separator = _configReader.Settings.CsvSeparator; _dateFormat = _configReader.Settings.DateFormatForFileName; _fileNameExtension = _configReader.Settings.CsvFileNameExtension; _cultureInfo = new CultureInfo(_configReader.Settings.CultureInfo); _logger.Debug($"Base directory is {BaseDirectory} from config file."); _logger.Debug($"Working directory is {WorkingDirectory} from config file."); _logger.Debug($"Backup directory is {BackupDirectory} from config file."); _logger.Debug($"File name for file writing is {_fileName} from config file."); _logger.Debug($"File name extension is {_fileNameExtension} from config file."); _logger.Debug($"Culture info for file writing is {_cultureInfo} from config file."); _logger.Debug($"CSV separator is {_separator} from config file."); }