Exemplo n.º 1
0
        public void AddNewVehicle(string registrationNumber)
        {
            IVehicle.VehicleTypes type = GarageHandler.GetVehicleType();
            string modelVehicle        = GarageHandler.GetModelName();

            Color.ColorCars color = GarageHandler.GetColor();
            Vehicles        newVehicle;

            newVehicle = iVehicle.CreateVehicle(registrationNumber, modelVehicle, type, color);
            GarageHandler.SetColor(newVehicle);
            AddNewVehicleGarage(newVehicle);
        }
Exemplo n.º 2
0
        public static void SetColor(Vehicles vehiclecolor)
        {
            Color.ColorCars color;
            Type            vehicleType       = vehiclecolor.GetType();
            PropertyInfo    colorPropertyInfo = vehicleType.GetProperty("ColorCar");

            if (colorPropertyInfo != null)
            {
                color = GarageHandler.GetColor();
                colorPropertyInfo.SetValue(vehiclecolor, color, null);
            }
        }