public void AddCar(Car c) { listView1.Items.Add(c.ID.ToString(), c.ToString(), CarImageIndex(c)); if (currentFilter != IdentityFilter.get()) { ReloadData(parent.cars); } else { int count = int.Parse(toolStripStatusLabel1.Text); toolStripStatusLabel1.Text = (++count).ToString(); } }
public void EditCar(Car c) { foreach (ListViewItem i in listView1.Items) { if (i.Name == c.ID.ToString()) { i.Text = c.ToString(); i.ImageIndex = CarImageIndex(c); } } if (currentFilter != IdentityFilter.get()) { ReloadData(parent.cars); } }
public void DeleteCar(Car c) { foreach (ListViewItem i in listView1.Items) { if (i.Name == c.ID.ToString()) { listView1.Items.Remove(i); } } if (currentFilter != IdentityFilter.get()) { ReloadData(parent.cars); } else { int count = int.Parse(toolStripStatusLabel1.Text); toolStripStatusLabel1.Text = (--count).ToString(); } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { currentFilter = IdentityFilter.get(); ReloadData(parent.cars); } else if (comboBox1.SelectedIndex == 1) { currentFilter = before100; ReloadData(parent.cars); } else if (comboBox1.SelectedIndex == 2) { currentFilter = after100; ReloadData(parent.cars); } else { } }
public CarView(ParentView parent_) { InitializeComponent(); parent = parent_; currentFilter = IdentityFilter.get(); }