예제 #1
0
        public void DatabaseCacheTest_2()
        {
            DatabaseCacheTest();

            var provider    = new SQLiteDataProvider(@"..\..\..\test_database\resources\covid.db");
            var cacheSystem = new DatabaseCache();

            cacheSystem.Attach(provider);
            cacheSystem.CheckUpdate();    //check if the data is fresh (yesterday is present in the db) and update the db if not
        }
예제 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var provider = new SQLiteDataProvider();

            var cacheSystem = new DatabaseCache();

            cacheSystem.Attach(provider);
            cacheSystem.CheckUpdate();    //check if the data is fresh (yesterday is present in the db)

            var data = provider.GetCountryData();

            MapView     mapView     = new MapView(data);
            IView       globalView  = new GlobalView(data);
            CountryView countryView = new CountryView(data);

            mapView.Subscribe(countryView);

            Application.Run(new MainForm(new List <IView> {
                mapView, globalView, countryView
            }));
        }