Пример #1
0
 void btnSave_Click(object sender, RoutedEventArgs e)
 {
     if (curSetting != null)
     {
         curSetting.Assign();
     }
     GrblSettings.Save();
 }
Пример #2
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (curSetting != null)
            {
                curSetting.Assign();
            }

            model.Message = string.Empty;

            GrblSettings.Save();
        }
Пример #3
0
        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();
                        }
                    }
                }
            }
        }