예제 #1
0
 public override string ToString()
 {
     return(Name + "\t" +
            Price.ToString("C") + "\t" +
            TopSpeed.ToString() + " mph\t" +
            Horsepower.ToString() + " hp");
 }
예제 #2
0
        public void AddToListView(ListView listview)
        {
            ListViewItem item = listview.Items.Add(Name);

            item.SubItems.Add(Price.ToString("C"));
            item.SubItems.Add(TopSpeed.ToString());
            item.SubItems.Add(Horsepower.ToString());
            item.Tag = this;
        }
예제 #3
0
        void CalculateInfo()
        {
            string[] infoArr =
            {
                "Wheels",     Wheels.ToString(),
                "Top Speed",  TopSpeed.ToString(),
                "Gears",      Gears.ToString(),
                "Fuel Level", FuelLevel.ToString()
            };

            for (int i = 0; i < infoArr.Length; i++)
            {
                Info = Info + infoArr[i] + ": ";
                i++;
                Info = Info + infoArr[i] + "\n";
            }
        }
예제 #4
0
 public override string ToString()
 {
     return(String.Format("{0}\t{1}\t{2}\t{3}", Name, Price.ToString("C"), TopSpeed.ToString(), Horsepower.ToString()));
 }
예제 #5
0
 public override bool Matches(string keyword)
 {
     return(base.Matches(keyword) ||
            TopSpeed.ToString() == keyword ||
            (HasSideCar && (keyword.ToLower() == "sidovagn" || keyword.ToLower() == "side car")));
 }