diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-24 17:39:01 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-12-24 17:39:01 +0200 |
| commit | 795444f234f6b45bc83d5c7b28725bd7ebc7ee89 (patch) | |
| tree | 7b2d86f0118c65316e0b9a965a60c1386749369a /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 0fb83fb3abb456ee6707b7f3cabc6b0c1ab2281b (diff) | |
| download | Tango-795444f234f6b45bc83d5c7b28725bd7ebc7ee89.tar.gz Tango-795444f234f6b45bc83d5c7b28725bd7ebc7ee89.zip | |
Working on machine service and machine studio.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
4 files changed, 10 insertions, 47 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index 450756705..4acc76c25 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -63,6 +63,8 @@ namespace Tango.MachineStudio.UI.Authentication }).Result; + AccessToken = response.Token; + ObservablesContext.OverrideSettingsDataSource(response.DataSource); ObservablesStaticCollections.Instance.Initialize(); @@ -107,5 +109,10 @@ namespace Tango.MachineStudio.UI.Authentication { CurrentUser = null; } + + /// <summary> + /// Gets the access token that was retrieved at the last login. + /// </summary> + public string AccessToken { get; private set; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs index 6e8d0488b..283ea3637 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -91,48 +91,6 @@ namespace Tango.MachineStudio.UI.ViewModels { try { - Status = "Checking for critical updates..."; - - LogManager.Log("Checking for forced update..."); - - var client = new MachineStudioUpdateService(); - - CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() - { - Email = "ForceUpdate", - Password = "ForceUpdate", - Version = ApplicationManager.Version.ToString(), - }).Result; - - if (response.IsUpdateAvailable && response.ForcedUpdate) - { - LogManager.Log("Forced update found, Navigating to update view!"); - - InvokeUI(() => - { - if (_notificationProvider.ShowQuestion("Machine Studio has detected a critical update which must be installed in order for the application to run properly. Do you wish to download and install this update?")) - { - TangoMessenger.Default.Send(new Messages.ForcedUpdateMessage() { UpdateResponse = response }); - _navigationManager.NavigateTo(NavigationView.UpdateView); - } - else - { - ApplicationManager.ShutDown(); - } - - IsLoading = false; - }); - - return; - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error checking for forced update!"); - } - - try - { Status = "Connecting to Team Foundation Services..."; _tfs.Initialize(); Thread.Sleep(500); 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 befad162c..818d507ae 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -363,8 +363,7 @@ namespace Tango.MachineStudio.UI.ViewModels CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() { - Email = _authenticationProvider.CurrentUser.Email, - Password = _authenticationProvider.CurrentUser.Password, + Token = _authenticationProvider.AccessToken, Version = _applicationManager.Version.ToString(), AcceptBetaRelease = _settings.AcceptBetaRelease, }).Result; @@ -455,7 +454,7 @@ namespace Tango.MachineStudio.UI.ViewModels //Check machine exist on my database first if (x.SelectedMachine.Machine == null) { - _notificationProvider.ShowError( $"The specified machine '{x.SelectedMachine.SerialNumber}' could not be found on the database. Aborting connection."); + _notificationProvider.ShowError($"The specified machine '{x.SelectedMachine.SerialNumber}' could not be found on the database. Aborting connection."); return; } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs index 3fec96629..e19dcdbe5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -196,8 +196,7 @@ namespace Tango.MachineStudio.UI.ViewModels CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() { - Email = _authentication.CurrentUser.Email, - Password = _authentication.CurrentUser.Password, + Token = _authentication.AccessToken, Version = _application.Version.ToString(), AcceptBetaRelease = settings.AcceptBetaRelease, }).Result; |
