private void initUniqueCarProperties(Dictionary <string, string> additionaPropertiesDictionary) { string carPropertyValue; bool wasValueRetrieved = true; wasValueRetrieved = additionaPropertiesDictionary.TryGetValue(GarageConstants.k_KeyColor, out carPropertyValue); CarColor = (eCarColor)Enum.Parse(typeof(eCarColor), carPropertyValue); wasValueRetrieved = wasValueRetrieved && additionaPropertiesDictionary.TryGetValue(GarageConstants.k_KeyNumOfDoors, out carPropertyValue); NumOfDoorsInCar = (eNumDoorsInCar)Enum.Parse(typeof(eNumDoorsInCar), carPropertyValue); if (wasValueRetrieved != true) { throw new Exception("One or more of the properties was not found"); } }
public Car(string i_ModelName, string i_LicenceNumber) : base(i_ModelName, i_LicenceNumber, k_NumOfWheels) { CarColor = eCarColor.NotDetermined; NumOfDoorsInCar = eNumDoorsInCar.NotDetermined; }