aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-10-14 12:29:29 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-14 12:29:29 +0300
commitc1686b546c6ecad789b7e5c6f67cb6b885363911 (patch)
tree848eeffda2ad976ab8204a1b119a7a2a34369d35 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication
parent433b17357847457029775512097eed0a4ade70a6 (diff)
downloadTango-c1686b546c6ecad789b7e5c6f67cb6b885363911.tar.gz
Tango-c1686b546c6ecad789b7e5c6f67cb6b885363911.zip
Enabled KeepAlive and for machine studio and implemented a connection lost dialog.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs23
1 files changed, 21 insertions, 2 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 8eff9ea4e..e6c687b92 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -22,6 +22,9 @@ using Tango.Core.DI;
using Tango.BL.Entities;
using Tango.BL;
using Tango.MachineStudio.UI.ViewModels;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.MachineStudio.UI.Views;
+using Tango.Integration.Operation;
namespace Tango.MachineStudio.UI.StudioApplication
{
@@ -34,16 +37,18 @@ namespace Tango.MachineStudio.UI.StudioApplication
{
private INavigationManager _navigationManager;
private IStudioModuleLoader _moduleLoader;
+ private INotificationProvider _notification;
private List<Window> _openedWindows;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class.
/// </summary>
/// <param name="navigationManager">The navigation manager.</param>
- public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader)
+ public DefaultStudioApplicationManager(INavigationManager navigationManager, IStudioModuleLoader moduleLoader, INotificationProvider notification)
{
_moduleLoader = moduleLoader;
_navigationManager = navigationManager;
+ _notification = notification;
_openedWindows = new List<Window>();
Application.Current.MainWindow.ContentRendered += (_, __) =>
@@ -109,8 +114,22 @@ namespace Tango.MachineStudio.UI.StudioApplication
if (e == Transport.TransportComponentState.Disconnected || e == Transport.TransportComponentState.Failed)
{
ConnectedMachine = null;
- }
+ if (e == Transport.TransportComponentState.Failed)
+ {
+ String failed_reason = (sender as IMachineOperator).FailedStateException.Message;
+
+ ConnectionLostViewVM vm = new ConnectionLostViewVM()
+ {
+ Exception = failed_reason
+ };
+
+ InvokeUI(() =>
+ {
+ _notification.ShowModalDialog<ConnectionLostViewVM, ConnectionLostView>(vm, (x) => { }, () => { });
+ });
+ }
+ }
}
/// <summary>