Пример #1
0
        public void Open()
        {
            m_UI.Menu();
            int  actionChoise = m_UI.GetUserActionChoise();
            bool garageOpen   = true;

            while (garageOpen)
            {
                try
                {
                    switch (actionChoise)
                    {
                    case 1:
                    {
                        insertVehicle();
                        break;
                    }

                    case 2:
                    {
                        displayLicensePlates();
                        break;
                    }

                    case 3:
                    {
                        changeVehicleStatus();
                        break;
                    }

                    case 4:
                    {
                        inflateWheelsToMaximum();
                        break;
                    }

                    case 5:
                    {
                        fillGasVehicle();
                        break;
                    }

                    case 6:
                    {
                        fillElectricVehicle();
                        break;
                    }

                    case 7:
                    {
                        displayVehicleInfo();
                        break;
                    }

                    case 8:
                    {
                        garageOpen = false;
                        break;
                    }
                    }
                }
                catch (Exception ex)
                {
                    m_UI.AnnounceError(ex);
                }

                if (actionChoise != 8)
                {
                    m_UI.AskUserPressSomethingToCont();
                    m_UI.Menu();
                    actionChoise = m_UI.GetUserActionChoise();
                }
            }
        }