public MainWindow() { InitializeComponent(); threadMonitor.ThreadEvent += Thread_MessageReciever; Auction testAuction = new Auction("Sofabord", 1, 10); Auctions.Add(testAuction); listBoxAuctions.Items.Add(Auctions[0].Name); cbTime.Items.Add(1); tcpListener = new TcpListener(IPAddress.Any, 1234); tcpListener.Start(); tbConsole.Text += "Server started\n"; Thread acceptingClientsThread = new Thread(AcceptingClients); acceptingClientsThread.Start(); }
private void btnAddAuction_Click(object sender, RoutedEventArgs e) { string name = tbName.Text; int time = int.Parse(cbTime.SelectedValue.ToString()); Auction newAuction = new Auction(name, time, 10); Auctions.Add(newAuction); listBoxAuctions.Items.Add(Auctions[Auctions.Count - 1].Name); }