示例#1
0
        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();
        }
示例#2
0
        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);
        }