33 private bool? YesNoCancel(
string title,
string message)
35 MessageBoxResult result = MessageBox.Show(message, title,
36 MessageBoxButton.YesNoCancel, MessageBoxImage.Warning);
37 if (result == MessageBoxResult.Yes)
39 else if (result == MessageBoxResult.No)
41 else if (result == MessageBoxResult.Cancel)
45 ApplicationException(app.FindStringResource(
"UnexpectedErrorMessage"));
53 private string GetPathToOpenFile(
string filter)
55 OpenFileDialog ofd =
new OpenFileDialog();
57 bool? result = ofd.ShowDialog();
69 private string GetPathToSaveFile(
string filter)
71 SaveFileDialog sfd =
new SaveFileDialog();
73 bool? result = sfd.ShowDialog();
86 return YesNoCancel(app.FindStringResource(
"MainWindow_Title"),
87 app.FindStringResource(
"SaveChanges"));
96 return GetPathToOpenFile(app.FindStringResource(
"GeometricTopologiesFilter"));
105 return GetPathToSaveFile(app.FindStringResource(
"GeometricTopologiesFilter"));
114 return GetPathToOpenFile(app.FindStringResource(
"ParametersFilter"));
123 return GetPathToSaveFile(app.FindStringResource(
"ParametersFilter"));
132 MessageBox.Show(errorMessage, app.FindStringResource(
"MainWindow_Title"),
133 MessageBoxButton.OK, MessageBoxImage.Error);
GUIInteractions logic for App.xaml
string GetPathToOpenTopologyFile()
Provide OpenFileDialog to open the topology file.
Class implements IInteractions interface by message boxes or dialogs.
Interface for interactions with user.
string GetPathToOpenParametersFile()
Asking which parameters file to open for loading.
bool SaveChangesYesNoCancel()
Provide MessageBoxButton to ask question whether to save changes.
void ScreamErrorMessage(string errorMessage)
Provide MessageBox to scream error message.
string GetPathToSaveParametersFile()
Asking which paramters file the data to be saved into.
string GetPathToSaveTopologyFile()
Provide SaveFileDialog to get the path to file the topology to be saved to.