Ejemplo n.º 1
0
        public override List <string> GetUniqueInfo()
        {
            List <string> carInfoList = new List <string>();

            carInfoList.Add(string.Format("The car has {0} doors.", m_NumberOfDoors.ToString()));
            carInfoList.Add(string.Format("The car color is {0}", m_CarColor.ToString()));
            return(carInfoList);
        }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return(string.Format(
                "Color: {0}\nNumber of doors: {1}\n{2}",
                m_Color.ToString(),
                m_NumOfDoors.ToString(),
                base.ToString()));
 }
Ejemplo n.º 3
0
        public override Dictionary <string, string> GetDetails()
        {
            Dictionary <string, string> carDetails = base.GetDetails();

            carDetails.Add("Car color", m_CarColor.ToString());
            carDetails.Add("Number of doors", m_NumberOfDoors.ToString());

            return(carDetails);
        }
Ejemplo n.º 4
0
        public override string ToString()
        {
            StringBuilder Car = new StringBuilder();

            Car.AppendLine();
            Car.AppendFormat(base.ToString());
            Car.AppendFormat("car color is: {0}, ", m_Color.ToString());
            Car.AppendFormat("Number of doors is: {0}.", m_NumOfDoors.ToString());
            return(Car.ToString());
        }
Ejemplo n.º 5
0
        public override string ToString()
        {
            return(string.Format(
                       @"{0}
Color:{1}
Number of doors:{2}",
                       base.ToString(),
                       m_Color.ToString(),
                       m_AmountOfDoors.ToString()));
        }
Ejemplo n.º 6
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat(
                @"Car color : {0}:
Number of doors : {1}
", m_CarColor.ToString(), NumberOfDoors.ToString());

            return(base.ToString() + stringBuilder.ToString());
        }
Ejemplo n.º 7
0
Archivo: Car.cs Proyecto: YoniME/DN-EX3
        public override string GetDetails()
        {
            StringBuilder carDetails = new StringBuilder();

            carDetails.AppendFormat("{0}", base.GetDetails());
            carDetails.AppendFormat("Color: {0}{1}", m_CarColor.ToString(), Environment.NewLine);
            carDetails.AppendFormat("Number of doors: {0}{1}", m_NumberOfDoors.ToString(), Environment.NewLine);
            carDetails.AppendFormat("{0}{1}", EnergySource.GetEnergySourceDetails(), Environment.NewLine);
            carDetails.AppendFormat("{0}", GetWheelsDetails());

            return(carDetails.ToString());
        }
Ejemplo n.º 8
0
        public override string ToString()
        {
            string carData = string.Format(
                @"{0}
Car color: {1}
Num of doors: {2}",
                base.ToString(),
                m_Color.ToString(),
                m_NumOfDoors.ToString());

            return(carData);
        }
Ejemplo n.º 9
0
Archivo: Car.cs Proyecto: itonroe/IDC
        public override Dictionary <string, Dictionary <Dictionary <string, string>, string[]> > PropertiesToDictionary()
        {
            Dictionary <string, Dictionary <Dictionary <string, string>, string[]> > properties = base.PropertiesToDictionary();

            Dictionary <Dictionary <string, string>, string[]> properties_car = new Dictionary <Dictionary <string, string>, string[]>();

            Dictionary <string, string> carColor = new Dictionary <string, string>();

            carColor.Add("Color", m_Color.ToString());

            Dictionary <string, string> numOfDoors = new Dictionary <string, string>();

            numOfDoors.Add("Number of Doors", m_NumOfDoors.ToString());

            properties_car.Add(carColor, Enum.GetNames(typeof(eCarColor)));
            properties_car.Add(numOfDoors, Enum.GetNames(typeof(eCarNumOfDoors)));

            properties.Add("Car", properties_car);

            return(properties);
        }
Ejemplo n.º 10
0
 // $G$ DSN-999 (-3) You should have implemented this by overriding ToString
 public override string GetSpecificDetails()
 {
     return(string.Format("The car's color: {0}, The number of doors: {1}", m_CarColor.ToString(), m_NumberOfDoors.ToString()));
 }
Ejemplo n.º 11
0
 public override string ToString()
 {
     return(string.Format("{0}Amount Of Doors: {1}    Car Color: {2}{3}", base.ToString(), m_AmountOfDoors.ToString(), m_CarColor.ToString(), Environment.NewLine));
 }
Ejemplo n.º 12
0
 public override string ToString()
 {
     return(string.Format(@"Car's Color: {0} Car's doors number: {1}", m_Color.ToString(), m_DoorsNumber.ToString()));
 }
Ejemplo n.º 13
0
        public override string ToString()
        {
            StringBuilder carString = new StringBuilder(base.ToString());

            carString.Append(string.Format("\nCar details:\nCar Color:{0}\nNumber of Doors:{1}\n", m_CarColor.ToString(), m_NumOfDoors.ToString()));

            return(carString.ToString());
        }