123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- 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.Collections;
- using AGV_WPF.Services;
- using System.Net.Sockets;
- namespace AGV_WPF.ExtraUI
- {
- /// <summary>
- /// ClientListWindow.xaml 的交互逻辑
- /// </summary>
- public partial class ClientListWindow : Window
- {
- public ClientListWindow()
- {
- InitializeComponent();
- Server.ClientChanged += new EventHandler(Server_ClientChanged);
- }
- void Server_ClientChanged(object sender, EventArgs e)
- {
-
- this.Dispatcher.Invoke(new Action(delegate()
- {
- listBox1.Items.Clear();
- foreach (DictionaryEntry dic in Server.clientTable)
- {
- TcpClient client = dic.Key as TcpClient;
- if (client != null)
- listBox1.Items.Add(client.Client.RemoteEndPoint);
- }
- }));
- }
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
-
- this.Dispatcher.Invoke(new Action(delegate()
- {
- listBox1.Items.Clear();
- foreach (DictionaryEntry dic in Server.clientTable)
- {
- TcpClient client = dic.Key as TcpClient;
- if (client != null)
- listBox1.Items.Add(client.Client.RemoteEndPoint);
- }
- }));
- }
- }
- }
|