|
@@ -96,6 +96,8 @@ namespace InABox.WPF
|
|
|
|
|
|
public static void ShowModal(string message, Action<IProgress<string>> work)
|
|
|
{
|
|
|
+ Exception? exception = null;
|
|
|
+
|
|
|
var progress = new ProgressForm
|
|
|
{
|
|
|
DisplayImage = DisplayImage
|
|
@@ -111,13 +113,27 @@ namespace InABox.WPF
|
|
|
worker.CancelAsync();
|
|
|
};
|
|
|
|
|
|
- worker.DoWork += (o, e) => work(update);
|
|
|
+ worker.DoWork += (o, e) =>
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ work(update);
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ exception = ex;
|
|
|
+ }
|
|
|
+ };
|
|
|
worker.RunWorkerCompleted +=
|
|
|
(o, e) => progress.Close();
|
|
|
worker.RunWorkerAsync();
|
|
|
};
|
|
|
|
|
|
progress.ShowDialog();
|
|
|
+ if(exception is not null)
|
|
|
+ {
|
|
|
+ throw exception;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static void Show(string message)
|