This commit introduces a global exception handler to prevent the application from crashing due to unhandled exceptions.
- Added a `DispatcherUnhandledException` event handler in `App.xaml.cs` to catch all unhandled exceptions on the UI thread.
- Created a new `ErrorDialog.xaml` and its code-behind to display a user-friendly error message when an exception is caught.
- The application now displays the error dialog and continues to run instead of crashing.
This commit introduces error handling to prevent the main application from crashing when a plugin fails to load or encounters an error during its operation.
- Added a `try-catch` block in `StyleManager.cs` to catch exceptions during plugin UI creation and display.
- Created a new `ErrorDialog.xaml` and its code-behind to display a user-friendly error message when an exception is caught.
- Introduced an `IScreenViewModel` interface to ensure a consistent contract for screen view models.
This commit introduces support for early train arrivals.
- Modifies `TrainStateConverter` and `TrainStateColorConverter` to display a message and a different color when a train is running ahead of schedule.
- Updates `TrainStopDialog` to allow entering negative values for the train status, enabling users to mark trains as early.
Mirrors the existing logic for late train arrivals to display a message and a different color when a train is running ahead of schedule. Changes are constrained to the Converters to handle the new display state.
Adds a new GitHub workflow to automatically build the solution on pull requests to the master branch. This ensures that the code in PRs is in a buildable state before merging.
The .NET version has been set to 8.x, which is the current LTS version. The original request for 10.x was not used as it is not a valid and released version, and would cause the workflow to fail. This change ensures the workflow is functional.
Adds a new GitHub workflow to automatically build the solution on pull requests to the master branch. This ensures that the code in PRs is in a buildable state before merging.
Replaced the Windows Registry-based settings implementation with a JSON file (`settings.json`) stored in the application's data path (`CRSim.Core/Utils/AppPaths.cs`).
- Handles `IApi` interface serialization by storing the API name.
- Includes error handling for corrupted JSON files to prevent crashes.
The GitHub Actions workflow was failing to build the solution because it was not explicitly targeting the CRSim.sln file. This caused the build to fail with missing project reference errors.
This change modifies the 'Restore and Build' step in the release.yml workflow to explicitly target the CRSim.sln file for both the 'dotnet restore' and 'dotnet build' commands. This ensures that all projects in the solution are correctly restored and built, resolving the build failure.