Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. using System.Timers;
  15.  
  16. namespace WpfApp1
  17. {
  18. /// <summary>
  19. /// Logika interakcji dla klasy Window3.xaml
  20. /// </summary>
  21.  
  22. public partial class Window3 : Window
  23. {
  24. public static List<Stop> ArriveList = null;
  25. public static List<Stop> DepartureList = null;
  26. string date { get; set; }
  27. private int m_nStart = 0;
  28. string miejsce { get; set; }
  29. Timer oTimer;
  30. public Window3()
  31. {
  32. InitializeComponent();
  33. date = MainWindow.date;
  34. miejsce = MainWindow.miejsce;
  35. label.Content = MainWindow.miejsce;
  36. InitTable();
  37. //lstTrain.ItemsSource = SQLCommand.Search(date, MainWindow.miejsce, ArriveList);
  38. //lstTrain_Copy.ItemsSource = SQLCommand.Search(date, MainWindow.miejsce, DepartureList);
  39. pierdolnik();
  40. }
  41. void pierdolnik()
  42. {
  43. oTimer = new Timer();
  44. m_nStart = Environment.TickCount;
  45. oTimer.Elapsed += new ElapsedEventHandler(OnTimeEvent);
  46. oTimer.Interval = 10000;
  47. oTimer.Enabled = true;
  48. //oTimer.Start();
  49. }
  50. public void InitTable()
  51. {
  52. lstTrain.ItemsSource = ArriveList;
  53. ArriveList = SQLCommand.Search(date, miejsce, ArriveList);
  54. lstTrain_Copy.ItemsSource = SQLCommand.Search(date, miejsce, DepartureList);
  55. }
  56. private void OnTimeEvent(object oSource,
  57. ElapsedEventArgs oElapsedEventArgs)
  58. {
  59. MessageBox.Show("1");
  60. InitTable();
  61. }
  62. private void button_Click(object sender, RoutedEventArgs e)
  63. {
  64. // Refresh klik
  65. miejsce = textBox.Text;
  66. //InitTable();
  67. }
  68.  
  69. private void textBox_TextChanged(object sender, TextChangedEventArgs e)
  70. {
  71. miejsce = textBox.Text;
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement