private void SCSSdkClientDemo_FormClosing(object sender, FormClosingEventArgs e) { Telemetry.pause(); // that line make it possible, but not every application wants to ask the user to quit, need to see if i can change that, when not use the try catch and IGNORE it (nothing changed ) if (MessageBox.Show("Are you sure you want to quit?", "My Application", MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; Telemetry.resume(); return; } Telemetry.Dispose(); }
private void ArduinoETS2Telemetry_FormClosing(object sender, FormClosingEventArgs e) { Telemetry.pause(); // that line make it possible, but not every application wants to ask the user to quit, need to see if i can change that, when not use the try catch and IGNORE it (nothing changed ) if (MessageBox.Show("Are you sure you want to quit?", "Arduino-ETS2-Server", MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; Telemetry.resume(); return; } else { RadioTimer.Dispose(); LocationTimer.Dispose(); UITimer.Dispose(); Telemetry.Dispose(); PortManager.Abort(); } }