private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { // FIND THE CITY DETAILS FROM THE XML City city = GetCity.FindCity(CityCode); AirportImage.Source = MultimediaLoad.LoadPngImage("Airports/" + city.AirportImage); NameLabel.Text = city.AirportName; AdressLabel.Text = city.AirportAdress; PhoneLabel.Text = city.AirportPhone.ToString(); if (ConditionDeviceEngine.CheckInternetStatus() == "Off") { ShowData(); progressIndicator = new ProgressIndicator(); progressIndicator.IsVisible = true; progressIndicator.Text = "Δεν βρέθηκε Σύνδεση στο Διαδίκτυο..."; SystemTray.SetProgressIndicator(this, progressIndicator); //SHOW LAST UPDATED DATA BEFORE TRY TO SYNC AGAIN } else { //SYNC ShowData(); SyncEngine syncworker = new SyncEngine(); syncworker.TestGetSaveWeatherForAirport(CityName, CityCode); Timer.Interval = TimeSpan.FromMilliseconds(2000); Timer.Tick += OnTimerTick; Timer.Start(); } }
private void RefreshButton_Click(object sender, RoutedEventArgs e) { if (ConditionDeviceEngine.CheckInternetStatus() == "Off") { MessageBox.Show("Δεν υπάρχει σύνδεση στο διαδίκτυο. Ο έλεγχος δεν μπορεί να πραγματοποιηθεί."); return; } SyncEngine syncworker = new SyncEngine(); syncworker.GetLastUpdateStatus(); RefreshCheckTimer.Interval = TimeSpan.FromMilliseconds(60); RefreshCheckTimer.Tick += new EventHandler(RefreshCheckTimer_Tick); RefreshCheckTimer.Start(); }
private void TryUpdateManuallyButton_Click(object sender, RoutedEventArgs e) { if (ConditionDeviceEngine.CheckInternetStatus() == "Off") { progressIndicator.IsVisible = true; progressIndicator.Text = "Δεν βρέθηκε Σύνδεση στο Διαδίκτυο..."; //SHOW LAST UPDATED DATA BEFORE TRY TO SYNC AGAIN return; } SyncEngine syncworker = new SyncEngine(); syncworker.TestGetSaveWeatherForAirport(CityName, CityCode); Timer.Interval = TimeSpan.FromMilliseconds(2000); Timer.Tick += OnTimerTick; Timer.Start(); }
private void MenuButton_Click(object sender, RoutedEventArgs e) { if (CanvasOption.Visibility == Visibility.Visible) { CanvasOption.Visibility = Visibility.Collapsed; CityList.Visibility = Visibility.Visible; MainLabel.Text = "Airport Weather Pro"; } else { CanvasOption.Visibility = Visibility.Visible; CityList.Visibility = Visibility.Collapsed; MainLabel.Text = "Menu"; } this.InternetStatusLabel.Text = ConditionDeviceEngine.CheckInternetStatus(); this.SyncDate.Visibility = Visibility.Collapsed; MemoryCheckTimer.Interval = TimeSpan.FromMilliseconds(60); MemoryCheckTimer.Tick += new EventHandler(MemoryCheckTimer_Tick); MemoryCheckTimer.Start(); }