private void SaveAsFileCommand_Executed(object prm) { // Save all changes to model ControllerVM.ProcessAllChanges(); // Check data integrity: do not save wrong data string s = IntegrityChecker.IsControllerDataOK(); if (s != null) { System.Windows.MessageBox.Show(s + "\n\nRegeling niet opgeslagen.", "Error bij opslaan: fout in regeling"); return; } // Save data to disk, update saved state SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.OverwritePrompt = true; saveFileDialog.Filter = "TLCGen files|*.tlc|TLCGen compressed files|*.tlcgz"; if (!string.IsNullOrWhiteSpace(DataProvider.Instance.FileName)) { saveFileDialog.FileName = DataProvider.Instance.FileName; } if (saveFileDialog.ShowDialog() == true) { DataProvider.Instance.FileName = saveFileDialog.FileName; DataProvider.Instance.SaveController(); ControllerVM.HasChanged = false; OnPropertyChanged("ProgramTitle"); MessageManager.Instance.Send(new UpdateTabsEnabledMessage()); ControllerVM.SetStatusText("regeling opgeslagen"); } }
private void SaveFileCommand_Executed(object prm) { if (string.IsNullOrWhiteSpace(DataProvider.Instance.FileName)) { SaveAsFileCommand.Execute(null); } else { // Save all changes to model ControllerVM.ProcessAllChanges(); // Check data integrity: do not save wrong data string s = IntegrityChecker.IsControllerDataOK(); if (s != null) { System.Windows.MessageBox.Show(s + "\n\nRegeling niet opgeslagen.", "Error bij opslaan: fout in regeling"); return; } // Save data to disk, update saved state DataProvider.Instance.SaveController(); ControllerVM.HasChanged = false; MessageManager.Instance.Send(new UpdateTabsEnabledMessage()); ControllerVM.SetStatusText("regeling opgeslagen"); } }
private void GenerateVisualCommand_Executed(object prm) { string result = SelectedGenerator?.Generator?.GenerateProjectFiles(ControllerVM.Controller, System.IO.Path.GetDirectoryName(DataProvider.Instance.FileName)); ControllerVM.SetStatusText(result); }