public MainWindow()
        {
            try
            {
                InitializeComponent();

                //System.Net.Sockets.UdpClient udpClient = new System.Net.Sockets.UdpClient("14.9.118.64", 8530);
                //udpClient.Send(new byte[] { 0 }, 1);

                udpProtocol = new UDPProtocol(localPort);
                udpProtocol.UdpSocketReceiveStart(RunCommand);

                listIPPort = new ObservableCollection <IPPort>();
                listUser   = new ObservableCollection <User>();

                chatWindowManager = new ChatWindowManager(udpProtocol);
                viewScreenManager = new ViewScreenManager(udpProtocol);

                listViewUsers.ItemsSource = listUser;

                SendIPPort();
                RefreshUserList();
                GetIPPortList();
                EnableControlButton(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace + Environment.NewLine + ex.Message);
            }
        }
 public ChatWindowManager(UDPProtocol udpProtocol)
 {
     this.udpProtocol = udpProtocol;
     listChatWindow   = new List <ChatWindow>();
 }
Exemplo n.º 3
0
 public ViewScreenManager(UDPProtocol udpProtocol)
 {
     this.udpProtocol     = udpProtocol;
     ListViewScreenWindow = new List <ViewScreenWindow>();
 }