private void StartupConnection(IAsyncResult iAr) { var client = _tcpListener.EndAcceptSocket(iAr); void StartConnection() { var connectionWindow = new ConnectionWindow(client); _connectionWindows.Add(connectionWindow); connectionWindow.Show(); } if (!CheckAccess()) { Dispatcher.Invoke(StartConnection); } else { StartConnection(); } WaitForDataListener(); }
public void Disconnect(ConnectionWindow connectionWindow) { _connectionWindows.Remove(connectionWindow); }