Switched messageboxes to custom events

This commit is contained in:
2023-04-02 22:40:47 +02:00
parent 18e4bbf535
commit ad88e3ebe1
2 changed files with 7 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
namespace Common;
public delegate void Error(Exception e);
public static class ConfigFileManager
{
#region Config flags
@@ -17,6 +18,7 @@ public static class ConfigFileManager
#endregion
private static Config Configuration;
public static event Error? ExceptionOccured;
public static void Init()
{
@@ -87,7 +89,7 @@ public static class ConfigFileManager
}
catch (Exception e)
{
MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
ExceptionOccured?.Invoke(e);
}
}
}