private void Form1_Load(object sender, EventArgs e) { bool retry = true; while (retry) { try { _a1 = new ArduinoOne(); retry = false; } catch { var dlg = MessageBox.Show("No Arduino #1 found. Retry?", "No Arduino #1 found", MessageBoxButtons.YesNo); if (dlg == DialogResult.No) retry = false; Application.Exit(); } } }
private void InitArduino1() { bool retry = true; while (retry) { try { _a1 = new ArduinoOne(); retry = false; } catch { var dlg = MessageBox.Show("No Arduino #1 found. Retry?", "No Arduino #1 found", MessageBoxButtons.YesNo); if (dlg == DialogResult.No) { retry = false; Application.Exit(); } } } }