void btnSave_Click(object sender, RoutedEventArgs e) { if (curSetting != null) { curSetting.Assign(); } GrblSettings.Save(); }
void btnSave_Click(object sender, RoutedEventArgs e) { if (curSetting != null) { curSetting.Assign(); } model.Message = string.Empty; GrblSettings.Save(); }
public void Activate(bool activate, ViewType chgMode) { if (model != null) { btnSave.IsEnabled = !model.IsCheckMode; model.Message = string.Empty; if (activate) { using (new UIUtils.WaitCursor()) { GrblSettings.Load(); } if (treeView.SelectedItem != null && treeView.SelectedItem is GrblSettingDetails) { ShowSetting(treeView.SelectedItem as GrblSettingDetails, false); } else if (dgrSettings.SelectedItem != null) { ShowSetting(dgrSettings.SelectedItem as GrblSettingDetails, false); } } else { if (curSetting != null) { curSetting.Assign(); } if (GrblSettings.HasChanges()) { if (MessageBox.Show((string)FindResource("SaveSettings"), "ioSender", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) { GrblSettings.Save(); } } } } }