diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-10-15 07:53:18 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-10-15 07:53:18 +0300 |
| commit | 94c14b3edbaec2f975df2f20175ba68c79a823ba (patch) | |
| tree | c3d8ac524f20d0cf0a3247a4505815caf365cf43 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication | |
| parent | fb2991bde321e59160a3dd821ecc08db87ac9217 (diff) | |
| parent | a6f139678b625cc5cd99f4065956d2b8230f420a (diff) | |
| download | Tango-94c14b3edbaec2f975df2f20175ba68c79a823ba.tar.gz Tango-94c14b3edbaec2f975df2f20175ba68c79a823ba.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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> |
