diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-31 13:23:54 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-31 13:23:54 +0300 |
| commit | a56427605302770b4c0a71a5ff4da439300a2250 (patch) | |
| tree | 176317dcfc861c4c82777dfdd916a83ae1dfd0f2 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | |
| parent | c728eba7cf217972c47e0a65afcb1975f6d6f6f1 (diff) | |
| download | Tango-a56427605302770b4c0a71a5ff4da439300a2250.tar.gz Tango-a56427605302770b4c0a71a5ff4da439300a2250.zip | |
Working on External bridge !
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 | 36 |
1 files changed, 18 insertions, 18 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 e53ec0b39..81f47c4ba 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -449,27 +449,27 @@ namespace Tango.MachineStudio.UI.ViewModels x.SelectedMachine.EnableEmbeddedDebugging = true; } - await x.SelectedMachine.Connect(); - - var authenticated = await x.SelectedMachine.As<IExternalBridgeSecureClient>().Authenticate(login.Password, Environment.MachineName, AuthenticationProvider.CurrentUser.Guid, "Machine Studio"); - if (!authenticated) + await x.SelectedMachine.As<IExternalBridgeSecureClient>().Connect(new PMR.Integration.ExternalBridgeLoginRequest() { - _notificationProvider.ShowError("It seems like you are not authorized to access the selected machine."); - } - else + AppID = "Machine Studio", + HostName = Environment.MachineName, + Password = login.Password, + UserGuid = AuthenticationProvider.CurrentUser.Guid, + Intent = PMR.Integration.ExternalBridgeLoginIntent.Override, + }); + + ApplicationManager.ConnectedMachine = x.SelectedMachine; + (x.SelectedMachine as IExternalBridgeSecureClient).SessionClosed += (_, __) => { - ApplicationManager.ConnectedMachine = x.SelectedMachine; - (x.SelectedMachine as IExternalBridgeSecureClient).SessionClosed += (_, __) => + InvokeUI(() => { - 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)); - } + _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)); + } catch (Exception ex) { |
