Beispiel #1
0
        private void OnExitingCommand(CancelEventArgs e)
        {
            bool promptToSaveChanges = EditorViewModels.Any(evm => evm.IsDirty);

            if (promptToSaveChanges)
            {
                var result = _showExitConfirmation();

                if (result == ExitConfirmationResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
                if (result == ExitConfirmationResult.No)
                {
                    return;
                }

                foreach (var editorViewModel in EditorViewModels)
                {
                    var editorConfiguration = new EditorConfiguration
                    {
                        FilePath  = editorViewModel.EditorPath,
                        Arguments = editorViewModel.Arguments,
                        IsEnabled = editorViewModel.IsEnabled
                    };

                    _writeConfiguration(editorViewModel.WorkflowName, editorConfiguration);
                }
            }
        }
 public ActionResult Add(EditorViewModels model)
 {
     if (ModelState.IsValid)
     {
         Editor item = new Editor();
         item.Id     = model.Id + 1;
         item.Otcher = model.Otcher;
         _context.Editors.Add(item);
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("Index"));
 }