Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using System.Timers;
- namespace WpfApp1
- {
- /// <summary>
- /// Logika interakcji dla klasy Window3.xaml
- /// </summary>
- public partial class Window3 : Window
- {
- public static List<Stop> ArriveList = null;
- public static List<Stop> DepartureList = null;
- string date { get; set; }
- private int m_nStart = 0;
- string miejsce { get; set; }
- Timer oTimer;
- public Window3()
- {
- InitializeComponent();
- date = MainWindow.date;
- miejsce = MainWindow.miejsce;
- label.Content = MainWindow.miejsce;
- InitTable();
- //lstTrain.ItemsSource = SQLCommand.Search(date, MainWindow.miejsce, ArriveList);
- //lstTrain_Copy.ItemsSource = SQLCommand.Search(date, MainWindow.miejsce, DepartureList);
- pierdolnik();
- }
- void pierdolnik()
- {
- oTimer = new Timer();
- m_nStart = Environment.TickCount;
- oTimer.Elapsed += new ElapsedEventHandler(OnTimeEvent);
- oTimer.Interval = 10000;
- oTimer.Enabled = true;
- //oTimer.Start();
- }
- public void InitTable()
- {
- lstTrain.ItemsSource = ArriveList;
- ArriveList = SQLCommand.Search(date, miejsce, ArriveList);
- lstTrain_Copy.ItemsSource = SQLCommand.Search(date, miejsce, DepartureList);
- }
- private void OnTimeEvent(object oSource,
- ElapsedEventArgs oElapsedEventArgs)
- {
- MessageBox.Show("1");
- InitTable();
- }
- private void button_Click(object sender, RoutedEventArgs e)
- {
- // Refresh klik
- miejsce = textBox.Text;
- //InitTable();
- }
- private void textBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- miejsce = textBox.Text;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement