aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-06-24 19:13:33 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-06-24 19:13:33 +0300
commita27ef72084d844ef703aaa9b1c6f4ec032ca182e (patch)
tree6899419d1dbce9e5509f7eec3c0415a3de232464 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
parent7e77e5877a6ab6a03c672199fd3edbe9395e4c45 (diff)
parent545f603c873cd026faf5560dae83da947f0a02a6 (diff)
downloadTango-a27ef72084d844ef703aaa9b1c6f4ec032ca182e.tar.gz
Tango-a27ef72084d844ef703aaa9b1c6f4ec032ca182e.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs42
1 files changed, 42 insertions, 0 deletions
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 5c8fb80ba..26be2d16b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs
@@ -17,6 +17,8 @@ using Tango.MachineStudio.Common.EventLogging;
using Tango.BL.Enumerations;
using Tango.MachineStudio.UI.TFS;
using Tango.MachineStudio.Common;
+using Tango.MachineStudio.Common.Update;
+using Tango.Core.DI;
namespace Tango.MachineStudio.UI.ViewModels
{
@@ -77,6 +79,46 @@ namespace Tango.MachineStudio.UI.ViewModels
{
try
{
+ LogManager.Log("Checking for forced update...");
+ var service = UpdateServiceHelper.GetUpdateServiceChannel();
+ var client = service.CreateChannel();
+
+ CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest()
+ {
+ Email = "ForceUpdate",
+ Password = "ForceUpdate",
+ Version = ApplicationManager.Version,
+ });
+
+ 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
+ {
_tfs.Initialize();
}
catch (Exception ex)