コード例 #1
0
        public override string UniqueVehicleInfo()
        {
            string lisenceTypeInfo    = "Motorcycle License Type: " + r_LicenseType.ToString();
            string engineCapacityInfo = "Motorcycle Engine Capacity: " + r_EngineCapacityInCC + " CC";

            return(string.Format("{0}\n{1}", lisenceTypeInfo, engineCapacityInfo));
        }
コード例 #2
0
        public override string ToString()
        {
            return(string.Format(base.ToString() +
                                 @"
License Type: {0}
Engine Capcity: {1}", m_LicenseType.ToString(), m_EngineCapacity.ToString()));
        }
コード例 #3
0
 public override string ToString()
 {
     return(string.Format("{1}{0}License type: {2}",
                          Environment.NewLine,
                          base.ToString(),
                          m_LicenseType.ToString()));
 }
コード例 #4
0
ファイル: Motorcycle.cs プロジェクト: Bar0hayon/Garage
 public override string ToString()
 {
     return(string.Format(
                "License Type: {0}\nEngineVolume: {1}\n{2}",
                m_LicenseType.ToString(),
                m_EngineVolume.ToString(),
                base.ToString()));
 }
コード例 #5
0
        public override string ToString()
        {
            string motorcycleDetials = base.ToString();

            motorcycleDetials += "License type: " + m_LicenseType.ToString() + System.Environment.NewLine;
            motorcycleDetials += "Engine capacity: " + r_EngineCapacity.ToString() + System.Environment.NewLine;
            return(motorcycleDetials);
        }
コード例 #6
0
        public override List <string> GetDetails()
        {
            List <string> detailsStrs = base.GetDetails();

            detailsStrs.Add("License type: " + m_LicenseType.ToString());
            detailsStrs.Add("Engine capacity: " + m_EngineCapacity.ToString());
            return(detailsStrs);
        }
コード例 #7
0
        public override Dictionary <string, string> GetDetails()
        {
            Dictionary <string, string> motorbikeDetails = base.GetDetails();

            motorbikeDetails.Add("License type", m_LicenseType.ToString());

            return(motorbikeDetails);
        }
コード例 #8
0
        public override string ToString()
        {
            StringBuilder infoOfMotorcycle = new StringBuilder();

            infoOfMotorcycle.AppendLine("Type of vehicle : Motorcycle");
            infoOfMotorcycle.AppendLine("Licence Type " + m_LicenseType.ToString());
            infoOfMotorcycle.AppendLine("The volume of the engine is: " + m_EngineVolume);
            return(infoOfMotorcycle.ToString());
        }
コード例 #9
0
        public override string ToString()
        {
            StringBuilder toReturnBuilder = new StringBuilder();

            toReturnBuilder.Append(base.ToString());
            toReturnBuilder.AppendFormat("License Type: {0}{1}", m_LicenseType.ToString(), Environment.NewLine);
            toReturnBuilder.AppendFormat("Engine Volume: {0}{1}", m_EngineVolume, Environment.NewLine);
            return(toReturnBuilder.ToString());
        }
コード例 #10
0
        public override string ToString()
        {
            StringBuilder Motorcycle = new StringBuilder();

            Motorcycle.AppendLine();
            Motorcycle.AppendFormat(base.ToString());
            Motorcycle.AppendFormat("license type  is: {0}, ", m_LicenseType.ToString());
            Motorcycle.AppendFormat("enginge capacity is: {0}.", m_EngineCapacity.ToString());
            return(Motorcycle.ToString());
        }
コード例 #11
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat(
                @"License Type : {0}
Engine Volume : {1}", m_LicenseType.ToString(), m_EngineVolume.ToString());

            return(base.ToString() + stringBuilder.ToString());
        }
コード例 #12
0
        public override string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.AppendFormat(
                @"License Type : {0}
Engine capacity : {1}
Vehicle type : {2}", m_LicenseType.ToString(), m_EngineCapacity.ToString(), VehicleType.ToString());

            return(base.ToString() + stringBuilder.ToString());
        }
コード例 #13
0
        public override string GetDetails()
        {
            StringBuilder motorcycleDetails = new StringBuilder();

            motorcycleDetails.AppendFormat("{0}", base.GetDetails());
            motorcycleDetails.AppendFormat("License type: {0}{1}", m_LicenseType.ToString(), Environment.NewLine);
            motorcycleDetails.AppendFormat("Engine displacement: {0}{1}", m_EngineDisplacement.ToString(), Environment.NewLine);
            motorcycleDetails.AppendFormat("{0}{1}", EnergySource.GetEnergySourceDetails(), Environment.NewLine);
            motorcycleDetails.AppendFormat("{0}", GetWheelsDetails());

            return(motorcycleDetails.ToString());
        }
コード例 #14
0
ファイル: Motorcycle.cs プロジェクト: ShayAvraham/Garage
        public override string ToString()
        {
            StringBuilder motorcycleDataBuilder = new StringBuilder();

            motorcycleDataBuilder.AppendLine("---Motorcycle Details---");
            motorcycleDataBuilder.AppendFormat("{0}{1}", base.ToString(), Environment.NewLine);
            motorcycleDataBuilder.AppendLine("---Unique Motorcycle Details---");
            motorcycleDataBuilder.AppendFormat("Engine Capacity: {0}{1}", m_MotorCapacity, Environment.NewLine);
            motorcycleDataBuilder.AppendFormat("License Type: {0}{1}", m_LicenseType.ToString(), Environment.NewLine);

            return(motorcycleDataBuilder.ToString());
        }
コード例 #15
0
        public override string ToString()
        {
            StringBuilder carDisplayString = new StringBuilder();

            carDisplayString.AppendLine(this.ToStringVehicle());
            carDisplayString.AppendFormat(
                "\tType of registration: {0}{2}\tMotor volume: {1}",
                r_LicenseType.ToString(),
                r_EngineVolume,
                Environment.NewLine);

            return(carDisplayString.ToString());
        }
コード例 #16
0
        public override string ToString()
        {
            string motorcycleInformationOutput = string.Format(
                @"{0}
Number of Wheels: {1}
License Type: {2}
Engine Capacity: {3}cc",
                VehicleToString(),
                (int)eNumberOfWheels.Motorcycle,
                m_LicenseType.ToString(),
                m_EngineCapacity);

            return(motorcycleInformationOutput);
        }
コード例 #17
0
ファイル: Motorcycle.cs プロジェクト: shaior/DotNet.Ex03
 public override string ToString()
 {
     return(string.Format(@"Motorcycle's license type: {0} Motorcycle's engine volume: {1}", m_LicenseType.ToString(), m_EngineVolume.ToString()));
 }
コード例 #18
0
        public override string ToString()
        {
            string motorcucleInfo;

            motorcucleInfo = string.Format("{0}" + Environment.NewLine + "Engine capacity: {1}" + Environment.NewLine + "License type: {2}", VehicleData(), m_EngineCapacity, m_LicenseType.ToString());
            return(motorcucleInfo);
        }
コード例 #19
0
 public override void GetDetailesOwnerVehicle(List <string> io_listOfDetailes) // this function add the Motorcycle detailes to the list
 {
     GetDetailesVehicle(io_listOfDetailes);
     io_listOfDetailes.Add(string.Format("License Type:{0}", m_licenseType.ToString()));
     io_listOfDetailes.Add(string.Format("Engine Volume In CC:{0}", m_engineVolumeInCC.ToString()));
 }
コード例 #20
0
 public override string GetSpecificDetails()
 {
     return(string.Format("The license type: {0}, The engine capacity: {1}", m_LicenseType.ToString(), m_EngineCapacity));
 }