Exemplo n.º 1
0
        /*====================================================================
        * Event Handlers
        * ==================================================================*/

        /*  On Mouse Click */
        private void OnClick(object sender, EventArgs eventArgs)
        {
            //Get mouse Arguments for mouse button used
            MouseEventArgs mouseEvent = eventArgs as MouseEventArgs;
            MouseButtons   mouseBtn   = mouseEvent.Button;

            //If Left click
            if (mouseBtn == MouseButtons.Left)
            {
                Console.WriteLine("Seat Left Clicked");

                //Send seat selection event to seating layout, so we can track multiple seats selected at a time
                parentUI.SeatClicked(this, seatObj, mouseBtn);
            }
            ;


            //If right click
            if (mouseBtn == MouseButtons.Right)
            {
                Console.WriteLine("Seat Right Clicked");

                //Load seat modification ui
                CreateModifySeatUI modifySeatUI = new CreateModifySeatUI(seatObj, this);
                modifySeatUI.Show();
            }
        }
Exemplo n.º 2
0
        private void ManagerClickedLayout(Point clickPos, MouseButtons mouseBtn)
        {
            //If no seat selected, create a seat
            if (!seatsSelected)
            {
                Seat               newSeat        = new Seat("NewSeat", clickPos.X, clickPos.Y, seatingLayout, Seat.SeatStates.Available, -1, -1);
                SeatUI             newSeatUI      = new SeatUI(newSeat, this);
                CreateModifySeatUI createSeatForm = new CreateModifySeatUI(newSeat, newSeatUI);
                allSeatUIs.Add(newSeatUI);
                createSeatForm.Show();
            }
            else
            {
                //Stop seat moving
                seatMoving = false;

                //Deselect seats
                DeselectAllSeats();
            }
        }