aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
commit57a828b4d11ab8274053ee035c8de8014ddd4ca1 (patch)
treec88e63b5e9019fe67cc3be451e46fbe57efc4a35 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication
parent2d55102532afaccc447c8a28ded8ccb93437683b (diff)
parentd6e2772dd98e6880de14ea12be0ef53bae24f763 (diff)
downloadTango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.tar.gz
Tango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.zip
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs30
1 files changed, 20 insertions, 10 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index 2c3c9ccb9..ed5f8b394 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -42,6 +42,7 @@ namespace Tango.MachineStudio.UI.StudioApplication
private INotificationProvider _notification;
private List<Window> _openedWindows;
private List<IStudioViewModel> _notified_view_models;
+ private bool _isDialogShown;
/// <summary>
/// Occurs when the application is ready.
@@ -139,19 +140,28 @@ namespace Tango.MachineStudio.UI.StudioApplication
{
String failed_reason = (sender as IMachineOperator).FailedStateException.Message;
- ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ if (!_isDialogShown)
{
- Exception = failed_reason,
- AutoReconnect = reconnect,
- };
+ _isDialogShown = true;
- InvokeUI(() =>
- {
- _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) =>
+ ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ {
+ Exception = failed_reason,
+ AutoReconnect = reconnect,
+ };
+
+ InvokeUI(() =>
{
- ReconnectionRequired?.Invoke(this, new EventArgs());
- }, () => { });
- });
+ _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) =>
+ {
+ _isDialogShown = false;
+ ReconnectionRequired?.Invoke(this, new EventArgs());
+ }, () =>
+ {
+ _isDialogShown = false;
+ });
+ });
+ }
}
}
}