private void btnSave_Click(object sender, RoutedEventArgs e) { try { if (comboPLC.SelectedItem is IO io) { MessageBox.Show(this, SaverLoader.Save(io.IOContext) ? "Saved successfuly" : "Error saving"); } } catch (Exception ex) { MessageBox.Show(this, ex.Message); } }
private void btnLoad_Click(object sender, RoutedEventArgs e) { try { if (comboPLC.SelectedItem is IO io) { if (SaverLoader.LoadCopyTo(io.IOContext)) { UpdateGUI(); MessageBox.Show(this, "Loaded successfuly"); } } } catch (Exception ex) { MessageBox.Show(this, (ex.InnerException ?? ex).Message); } }