private void DisconnectPortClick(object sender, RoutedEventArgs e) { try { _connection.ClosePort(); arduinoActions.StopActions(); } catch (IOException ioException) { MessageBox.Show(ioException.Message); } handleStopFetching(); }
/// <summary> /// Runs methods before application is completely closed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RunCloseCheckups(object sender, System.ComponentModel.CancelEventArgs e) { arduinoActions.StopActions(); _connection?.ClosePort(); }