Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            //Get list of connections
            conns = new TCPUDPConnections();
            conns.Refresh();

            //Set up task that refreshes connection periodically
            worker          = new BackgroundWorker();
            worker.DoWork  += WorkerRefreshConnections;
            _timer          = new Timer(500);
            _timer.Elapsed += TimerElapsed;
            _timer.Start();

            ConnectionsDataGrid.ItemsSource = new ObservableCollection <TCPUDPConnection>(conns);
        }