Example #1
0
        public void WeatherService_GetSLastUpdate(object sender, WeatherService.GetWeatherCompletedEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(e.Result))
                {
                    XDocument xdoc = XDocument.Parse(e.Result);

                    var Result = from a in xdoc.Descendants("CurrentWeather")
                                 select new
                    {
                        datetime = a.Element("Time"),
                    };

                    string dateTime = null;

                    foreach (var k in Result)
                    {
                        dateTime = k.datetime.Value;
                    }

                    LastUpdate["DateTime"] = dateTime.ToString();
                    DownloadServerResult   = SyncState.ServerSyncResult.Succeed;
                }
            }
            catch { DownloadServerResult = SyncState.ServerSyncResult.Failed; }
        }
Example #2
0
        public void GetLastUpdateStatus()
        {
            DownloadResult = SyncState.SyncResult.InActive;
            try
            {
                WeatherService.GlobalWeatherSoapClient client = new WeatherService.GlobalWeatherSoapClient();
                client.GetWeatherCompleted += new EventHandler <WeatherService.GetWeatherCompletedEventArgs>(WeatherService_GetSLastUpdate);
                client.GetWeatherAsync("Alexandroupoli", "Greece");
                DownloadServerResult = SyncState.ServerSyncResult.Downloading;
            }

            catch { MessageBox.Show("Σφάλμα ! Ο Server δεν Ανταποκρίθηκε έγκαιρα"); DownloadResult = SyncState.SyncResult.Failed; return; }
        }