//-----------------------------------------------------------------// public void ChangeVehicleState(string i_LicenseNumber, InformationOfVehicle.eVehicleStateInGarage i_NewState) { try { InformationOfVehicle vehicleInformation = this.CheckForLicensePlate(i_LicenseNumber); vehicleInformation.State = i_NewState; } catch (ArgumentException exception) { throw exception; } }
//-----------------------------------------------------------------// public string GetLicensePlatesByState(InformationOfVehicle.eVehicleStateInGarage i_State) { StringBuilder KeyString = new StringBuilder(); int index = 0; foreach (KeyValuePair <string, InformationOfVehicle> currentKey in this.m_VehiclesInTheGarage) { if (i_State == InformationOfVehicle.eVehicleStateInGarage.Default || currentKey.Value.State == i_State) { ++index; KeyString.Append(index.ToString() + ". "); KeyString.AppendLine(currentKey.Key); } } return(KeyString.ToString()); }