Exemple #1
0
 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;   
 }
Exemple #2
0
        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;
        }