diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-24 13:28:53 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-24 13:28:53 +0200 |
| commit | 7fff53b4e158212572dd0d83b5628e799e05ba01 (patch) | |
| tree | 05932505d589d261515657241d53072af381d108 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs | |
| parent | ecb6665c860f8d7270af9cf8eefaf9ff05e54d62 (diff) | |
| download | Tango-7fff53b4e158212572dd0d83b5628e799e05ba01.tar.gz Tango-7fff53b4e158212572dd0d83b5628e799e05ba01.zip | |
Implemented forced environment version in machine studio.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index c8e25e2d4..400d2c2f0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -10,11 +10,13 @@ using Tango.BL; using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.Core.Cryptography; +using Tango.Core.DI; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.EventLogging; using Tango.MachineStudio.Common.Navigation; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.UI.Messages; using Tango.Settings; using Tango.SharedUI; using Tango.Web; @@ -150,11 +152,26 @@ namespace Tango.MachineStudio.UI.ViewModels await Task.Factory.StartNew(() => { - - _settings.DeploymentSlot = DeploymentSlot; - _authenticationProvider.Login(Email, Password); + var result = _authenticationProvider.Login(Email, Password).Response; + + if (result.VersionChangeRequired) + { + InvokeUI(() => + { + if (_notificationProvider.ShowErrorQuestion($"Your version of Machine Studio is different from the version specified for the selected environment.\nMachine Studio must be changed to version '{result.RequiredVersion}' in order to continue.\nDo you wish to update your local version?")) + { + TangoMessenger.Default.Send(new ChangeVersionMessage() + { + LoginResponse = result, + }); + _navigationManager.NavigateTo(NavigationView.UpdateView); + } + }); + + return; + } _eventLogger.Log(EventTypes.APPLICATION_STARTED, "Application Started!"); |
