public override string ToString() { return(Name + "\t" + Price.ToString("C") + "\t" + TopSpeed.ToString() + " mph\t" + Horsepower.ToString() + " hp"); }
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; }
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"; } }
public override string ToString() { return(String.Format("{0}\t{1}\t{2}\t{3}", Name, Price.ToString("C"), TopSpeed.ToString(), Horsepower.ToString())); }
public override bool Matches(string keyword) { return(base.Matches(keyword) || TopSpeed.ToString() == keyword || (HasSideCar && (keyword.ToLower() == "sidovagn" || keyword.ToLower() == "side car"))); }