diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-31 10:56:22 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-07-31 10:56:22 +0300 |
| commit | 28d5e3b892df893ea3c918392566d1842fd85937 (patch) | |
| tree | 9b99e2fa17321243cf91407719b291ae729303f5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | |
| parent | eab3bef002de013b902499341266c79b92349594 (diff) | |
| parent | b6b2f9ad4c96deface6763adbb2ac533e9706d1b (diff) | |
| download | Tango-28d5e3b892df893ea3c918392566d1842fd85937.tar.gz Tango-28d5e3b892df893ea3c918392566d1842fd85937.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 278926de9..e53ec0b39 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -13,7 +13,7 @@ using System.Windows.Media; using Tango.BL.Entities; using Tango.Core.Commands; using Tango.Core.DI; -using Tango.Integration.Services; +using Tango.Integration.ExternalBridge; using Tango.Logging; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; @@ -451,7 +451,7 @@ namespace Tango.MachineStudio.UI.ViewModels await x.SelectedMachine.Connect(); - var authenticated = await x.SelectedMachine.As<IExternalBridgeSecureClient>().Authenticate(login.Password); + var authenticated = await x.SelectedMachine.As<IExternalBridgeSecureClient>().Authenticate(login.Password, Environment.MachineName, AuthenticationProvider.CurrentUser.Guid, "Machine Studio"); if (!authenticated) { _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); @@ -459,6 +459,14 @@ namespace Tango.MachineStudio.UI.ViewModels else { ApplicationManager.ConnectedMachine = x.SelectedMachine; + (x.SelectedMachine as IExternalBridgeSecureClient).SessionClosed += (_, __) => + { + InvokeUI(() => + { + _notificationProvider.ShowError("The remote machine has closed the current session. Machine disconnected."); + ApplicationManager.ConnectedMachine = null; + }); + }; PostMessage(new MachineConnectionChangedMessage() { Machine = x.SelectedMachine }); _eventLogger.Log(String.Format("Successfully connected to machine {0} via TCP", x.SelectedMachine.SerialNumber)); } |
