public Watchdog(Config config) { this.Logger = new Logger(); WatcherFactory factory = new WatcherFactory(this.Logger); this.Watchers = new List <BaseWatcher>(); if (config.Network.EnableWatcher) { NetworkWatcher watcher = factory.CreateNetworkWatcher(config.Octovisor); this.Watchers.Add(watcher); } foreach ((string procName, MonitorInfo procInfo) in config.Monitoring) { ProcessWatcher watcher = factory.CreateProcessWatcher(procName, procInfo); this.Watchers.Add(watcher); } }