aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs23
1 files changed, 23 insertions, 0 deletions
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 60a023071..f671251f7 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
@@ -158,6 +158,29 @@ namespace Tango.MachineStudio.UI.ViewModels
IsRollbackAvailable = File.Exists(GetRollbackFile());
TangoMessenger.Default.Register<Messages.ForcedUpdateMessage>(HandleForcedUpdateMessage);
+ TangoMessenger.Default.Register<Messages.ChangeVersionMessage>(HandleChangeVersionMessage);
+ }
+
+ private async void HandleChangeVersionMessage(ChangeVersionMessage msg)
+ {
+ ForcedUpdate = true;
+ InvalidateRelayCommands();
+
+ Status = UpdateStatus.CheckingForUpdate;
+
+ var client = new MachineStudioUpdateService();
+
+ DownloadLatestVersionResponse response = await client.DownloadLatestVersion(new DownloadLatestVersionRequest()
+ {
+ AccessToken = _authentication.AccessToken,
+ });
+
+ _updateInfo = new CheckForUpdatesResponse();
+ _updateInfo.BlobAddress = response.BlobAddress;
+ _updateInfo.Version = response.Version;
+ LatestVersion = _updateInfo.Version;
+
+ StartUpdate();
}
private void HandleForcedUpdateMessage(ForcedUpdateMessage msg)