diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs index 79dd2ec96..8fdd18abe 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Tango.Settings; using Tango.Transport.Web; +using Tango.Web; namespace Tango.MachineStudio.Common.Update { @@ -12,9 +13,11 @@ namespace Tango.MachineStudio.Common.Update { private WebTransportClient _client; + public DeploymentSlot Environment { get; set; } + public MachineStudioUpdateService() { - + Environment = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot; _client = new WebTransportClient(); } @@ -38,14 +41,14 @@ namespace Tango.MachineStudio.Common.Update return _client.PostJson<LatestVersionRequest, LatestVersionResponse>(GetAddress() + "GetLatestVersion", request); } - private String GetAddress() + public Task<DownloadLatestVersionResponse> DownloadLatestVersion(DownloadLatestVersionRequest request) { - return SettingsManager.Default.GetOrCreate<MachineStudioSettings>().GetMachineServiceAddress() + "/api/MachineStudio/"; + return _client.PostJson<DownloadLatestVersionRequest, DownloadLatestVersionResponse>(GetAddress() + "DownloadLatestVersion", request); } - public Task<DownloadLatestVersionResponse> DownloadLatestVersion(DownloadLatestVersionRequest request) + private String GetAddress() { - return _client.PostJson<DownloadLatestVersionRequest, DownloadLatestVersionResponse>(GetAddress() + "DownloadLatestVersion", request); + return Environment.ToAddress() + "/api/MachineStudio/"; } } } |
