Beispiel #1
0
 public void Ping()
 {
     Show[] sh = null;
     try
     {
         sh = SimpleGet.GetJsonObject <Show[]>("http://localhost:8070/api/client/view");
     }
     catch (Exception ex)
     {
         Dispatcher.Invoke(() =>
         {
             MessageBox.Show(ex.Message);
             Close();
         });
         return;
     }
     Dispatcher.Invoke(() =>
     {
         if (!Compare(sh.ToList(), shows.Items))
         {
             shows.ItemsSource = sh;
             shows.Items.Refresh();
         }
     });
     Thread.Sleep(10000);
     Ping();
 }
Beispiel #2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SimpleGet.Get($"http://localhost:8070/api/client/buy?id={show.Id}&count={count.Text}");
         Close();
     }
     catch { err.Content = "Ошибка"; }
 }