public Termometer(TimeSpan pollInterval) { var dataSourceProvider = new WeatherDataSourceProvider(); var dataSource = dataSourceProvider.DataSources.FirstOrDefault(o => o.Name == "Weather Riga"); if (dataSource == null) throw new Exception("Missing data source."); this.monitor = new RealTimeDataMonitor(dataSource, pollInterval); this.monitor.NewData += this.OnNewData; }
public Termometer(TimeSpan pollInterval) { var dataSourceProvider = new WeatherDataSourceProvider(); var dataSource = dataSourceProvider.DataSources.FirstOrDefault(o => o.Name == "Weather Riga"); if (dataSource == null) { throw new Exception("Missing data source."); } this.monitor = new RealTimeDataMonitor(dataSource, pollInterval); this.monitor.NewData += this.OnNewData; }