private void Watcher_Changed(object source, FileSystemEventArgs e) { var fileName = System.IO.Path.GetFileName(e.FullPath); var expectedFileName = Configuration.StatisticsFileName; if (fileName == expectedFileName) { var appData = AppDataManager.ReadFromFile <StatisticsData>(expectedFileName); CentralService.UpdateSettings(appData); } }
public void Start() { AppData = AppDataManager.ReadFromFile <AppData>(Configuration.AppFileName); StatisticsData = AppDataManager.ReadFromFile <StatisticsData>(Configuration.StatisticsFileName); var messageQueueName = Configuration.MessageQueueName; _queue = MessageQueue.Exists(messageQueueName) ? new MessageQueue(messageQueueName) : MessageQueue.Create(messageQueueName); foreach (var file in Directory.GetFiles(Configuration.DirectoryPath)) { _fileProcessor.ProcessFile(file); } }