示例#1
0
        public SeatController(FrmSeats view, FrmClient viewClient)
        {
            _viewSeat   = view;
            _viewClient = viewClient;
            _client     = new TcpClientController(host, port);
            _client.Connect();
            _client.ServerDataReceived += ServerDataReceivedHandler;

            QueryOccupiedSeats();
        }
示例#2
0
        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);
        }