From ead172c9292326266b2c1622f058df5e2039bd05 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 30 Jul 2018 18:16:30 +0300 Subject: Working on PPC Machine Studio External Bridge ! --- .../Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs') 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 d209e3f27..e53ec0b39 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -451,7 +451,7 @@ namespace Tango.MachineStudio.UI.ViewModels await x.SelectedMachine.Connect(); - var authenticated = await x.SelectedMachine.As().Authenticate(login.Password); + var authenticated = await x.SelectedMachine.As().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)); } -- cgit v1.3.1