private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("Поля должны быть заполненны!"); } else { listBox1.Items.Clear(); People newPeople = new People(); newPeople.Name = textBox1.Text; newPeople.Number = textBox2.Text; Peoples.Add(newPeople); for (int i = 0; i < Peoples.Count; i++) { listBox1.Items.Insert(i, Peoples.GetValue(i).Name + " - " + Peoples.GetValue(i).Number); } textBox1.Clear(); textBox2.Clear(); } }
public void AddTest() { SinglyList <String> testList = new SinglyList <string>(); testList.Add("aaaa"); }