aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
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.cs10
1 files changed, 9 insertions, 1 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 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<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));
}