Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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();
        }