Exemplo n.º 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;   
 }
Exemplo n.º 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;
        }