Esempio n. 1
0
 //print the vehicle states in our garage
 private static void displayStatesToChoose()
 {
     Console.WriteLine("Please choose a state:");
     foreach (eVehicleState state in Enum.GetValues(typeof(eVehicleState)))
     {
         if (!state.Equals(eVehicleState.Undefined))
         {
             Console.WriteLine("{0}. {1}", (int)state, VehicleStateToText.AsText(state));
         }
     }
 }
Esempio n. 2
0
        public override string ToString()
        {
            StringBuilder vehicleString = new StringBuilder();

            vehicleString.AppendFormat("Owner Name: {0}", r_OwnerName);
            vehicleString.AppendLine();
            vehicleString.AppendFormat("Owner phone number: {0}", r_OwnerPhoneNumber);
            vehicleString.AppendLine();
            vehicleString.AppendFormat("Vehicle details: {0}", r_Vehicle.ToString());
            vehicleString.AppendLine();
            vehicleString.AppendFormat("The {0} state is: {1}", r_Vehicle.ModelName, VehicleStateToText.AsText(m_State));

            return(vehicleString.ToString());
        }