/** * connect - connect to the server and make a new TCP connection. */ public void connect(string ip, int port) { ITelnetClient ITelnet = new MyTelnetClient(); this.model.SetTelnetClient(ITelnet); model.connect(ip, port); this.model.setStop(); }
public void createClient(string ip, int port) { ITelnetClient telnetClient = new MyTelnetClient(); this.telnetClient = telnetClient; telnetClient.connect(ip, port); }
public MainWindow() { InitializeComponent(); // vm = new SimulatorViewModel(new SimulatorModel(new MyTelnetClient())); // DataContext = vm; client = new MyTelnetClient(); client.Connect("127.0.0.1", 8080); Closed += (o, p) => { client.Disconnect(); }; }
public void App_Startup(object sender, StartupEventArgs e) { ITelnetClient telnetClient = new MyTelnetClient(); IFlightModel flightModel = new MyFlight(telnetClient); MainViewModel = new ViewModel(flightModel); MainViewModel.InitializeVM(); MainWindow mainWindow = new MainWindow(flightModel); FirstPage first = new FirstPage(); first.SetFlight(flightModel); first.SetMain(mainWindow); first.ShowDialog(); }