static void Main() { string connectionString = ConfigurationManager.ConnectionStrings["WeatherService"].ConnectionString; QueryFacade facade = new QueryFacade(connectionString); WeatherDataSummary summary = new WeatherDataSummary(facade); LongLatCalcs translator = new LongLatCalcs(connectionString); ConditionsRepository repo = new ConditionsRepository(connectionString); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWindow(summary, translator, repo)); }
internal WeatherDataSummary(QueryFacade facade) { _facade = facade; _logs = new List <ServiceEvent>(); Task summarizer = new Task(() => { try { while (true) { EarthquakeCount = facade.GetEarthquakeCount(); SolarWindCount = facade.GetSolarWindCount(); WeatherCount = facade.GetWeatherCount(); TopLogs = facade.GetTopLogs(); Thread.Sleep(250); } } catch (Exception) {} }); summarizer.Start(); }