public void StopWatchingFiles() { LogFileUpdateHandler.Reset(); _watcher.EnableRaisingEvents = false; foreach (var agentLogConsumer in Consumers) { agentLogConsumer.OnStoped(); } }
public void StartWatchingFiles(bool debugMode, string path, string fileFilter, params IAgentLogConsumer[] consumers) { LogFileUpdateHandler.Reset(); Consumers = consumers.ToList(); _watcher.Path = path; _watcher.NotifyFilter = NotifyFilters.LastWrite; _watcher.Filter = fileFilter; _watcher.Changed += OnChanged; _watcher.IncludeSubdirectories = true; _watcher.EnableRaisingEvents = true; foreach (var agentLogConsumer in Consumers) { agentLogConsumer.Start(debugMode); } }