public SeatController(FrmSeats view, FrmClient viewClient) { _viewSeat = view; _viewClient = viewClient; _client = new TcpClientController(host, port); _client.Connect(); _client.ServerDataReceived += ServerDataReceivedHandler; QueryOccupiedSeats(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var frmSeat = new FrmSeats(); var frmClient = new FrmClient(); var controller = new SeatController(frmSeat, frmClient); frmSeat.UserSitdown += controller.UserSitdownHandler; frmSeat.UserLeave += controller.UserLeaveHandler; frmClient.FormClosing += (object sender, FormClosingEventArgs e) => { frmSeat.OnUserLeave(); }; Application.Run(frmSeat); }