diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs | 23 |
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> |
