private void AddButton_Click_1(object sender, EventArgs e) { if (int.TryParse(AddTextBox.Text, out int value)) { var item = new SortedItem(value, items.Count); items.Add(item); DrawItems(items); } RefreshItems(); AddTextBox.Text = ""; }
private void FillButton_Click_1(object sender, EventArgs e) { if (int.TryParse(FillTextBox.Text, out int value)) { var rnd = new Random(); for (int i = 0; i < value; i++) { var item = new SortedItem(rnd.Next(100), items.Count); items.Add(item); } } RefreshItems(); FillTextBox.Text = ""; }