private void Add_Click(object sender, EventArgs e) { try { price = double.Parse(richTextBox3.Text); info = richTextBox2.Text; chance = double.Parse(richTextBox1.Text); AddEvent?.Invoke(this, null); ChangeEvent?.Invoke(this, null); AddSquare?.Invoke(this, null); AddTriangle?.Invoke(this, null); Close(); } catch { MessageBox.Show("Введите корректные данные"); } }
public void OnAdd_Square(ICalculatorComponent calculator) { AddSquare?.Invoke(calculator); }