private void buttonDraw_Click(object sender, EventArgs e) { try { mainChart.Series[0].Points.Clear(); Painter painter; var amdal = new Amdal(); if (radioButtonA.Checked) { amdal.N = int.Parse(textBoxN.Text); amdal.Ca = double.Parse(textBoxCa.Text); amdal.Ct = double.Parse(textBoxCt.Text); painter = new Painter(amdal, mainChart); painter.PaintRA(double.Parse(textBoxAfrom.Text), double.Parse(textBoxAto.Text), double.Parse(textBoxStep.Text)); } else if (radioButtonN.Checked) { amdal.A = double.Parse(textBoxA.Text); amdal.Ca = double.Parse(textBoxCa.Text); amdal.Ct = double.Parse(textBoxCt.Text); painter = new Painter(amdal, mainChart); painter.PaintRN(int.Parse(textBoxNfrom.Text), int.Parse(textBoxNto.Text), int.Parse(textBoxStep.Text)); } else if (radioButtonCa.Checked) { amdal.N = int.Parse(textBoxN.Text); amdal.A = double.Parse(textBoxA.Text); amdal.Ct = double.Parse(textBoxCt.Text); painter = new Painter(amdal, mainChart); painter.PaintRCa(double.Parse(textBoxCafrom.Text), double.Parse(textBoxCato.Text), double.Parse(textBoxStep.Text)); } else if (radioButtonCt.Checked) { amdal.N = int.Parse(textBoxN.Text); amdal.A = double.Parse(textBoxA.Text); amdal.Ca = double.Parse(textBoxCa.Text); painter = new Painter(amdal, mainChart); painter.PaintRCt(double.Parse(textBoxCtfrom.Text), double.Parse(textBoxCtto.Text), double.Parse(textBoxStep.Text)); } } catch (FormatException) { MessageBox.Show("Incorrect format of number"); } catch (Exception exception) { MessageBox.Show(exception.Message); } }
public Painter(Amdal amdal, Chart chart) { this.amdal = amdal; this.chart = chart; }