コード例 #1
0
ファイル: CarView.cs プロジェクト: shakandrew/Cars-WinForms
 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();
     }
 }
コード例 #2
0
ファイル: CarView.cs プロジェクト: shakandrew/Cars-WinForms
 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);
     }
 }
コード例 #3
0
ファイル: CarView.cs プロジェクト: shakandrew/Cars-WinForms
 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();
     }
 }
コード例 #4
0
ファイル: CarView.cs プロジェクト: shakandrew/Cars-WinForms
 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
     {
     }
 }
コード例 #5
0
ファイル: CarView.cs プロジェクト: shakandrew/Cars-WinForms
 public CarView(ParentView parent_)
 {
     InitializeComponent();
     parent        = parent_;
     currentFilter = IdentityFilter.get();
 }