aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-19 01:50:58 +0200
commit9736b8c8ede6a0d121dea8381f0abb561fad5631 (patch)
tree1c38f3f5be82b923ffae40fae00a25487179ab54 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
parentbe3343cc0268179c7a6f628fa5e68f323a3335e5 (diff)
downloadTango-9736b8c8ede6a0d121dea8381f0abb561fad5631.tar.gz
Tango-9736b8c8ede6a0d121dea8381f0abb561fad5631.zip
Implemented auto generated web clients for PPC and machine studio.
Improved interactions with web clients across solutions.
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.cs20
1 files changed, 8 insertions, 12 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 57043df0e..17edf1dfd 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs
@@ -25,7 +25,6 @@ using Tango.MachineStudio.UI.Messages;
using Tango.Settings;
using Tango.MachineStudio.Common;
using Tango.Transport.Web;
-using Tango.MachineStudio.Common.Web;
namespace Tango.MachineStudio.UI.ViewModels
{
@@ -56,6 +55,7 @@ namespace Tango.MachineStudio.UI.ViewModels
private CheckForUpdatesResponse _updateInfo;
private TemporaryFolder _newPackageTempFolder;
private TemporaryFolder _previousPackageTempFolder;
+ private MachineStudioWebClient _machineStudioWebClient;
private bool _forcedUpdate;
public bool ForcedUpdate
@@ -140,8 +140,9 @@ namespace Tango.MachineStudio.UI.ViewModels
public RelayCommand TryRollbackAgainCommand { get; set; }
- public UpdateViewVM(INotificationProvider notification, IAuthenticationProvider authentication, INavigationManager navigation, IStudioApplicationManager application)
+ public UpdateViewVM(MachineStudioWebClient machineStudioWebClient, INotificationProvider notification, IAuthenticationProvider authentication, INavigationManager navigation, IStudioApplicationManager application)
{
+ _machineStudioWebClient = machineStudioWebClient;
_notification = notification;
_navigation = navigation;
_application = application;
@@ -169,11 +170,9 @@ namespace Tango.MachineStudio.UI.ViewModels
Status = UpdateStatus.CheckingForUpdate;
- var client = new MachineStudioWebService();
-
- DownloadLatestVersionResponse response = await client.DownloadLatestVersion(new DownloadLatestVersionRequest()
+ DownloadLatestVersionResponse response = await _machineStudioWebClient.DownloadLatestVersion(new DownloadLatestVersionRequest()
{
- AccessToken = _authentication.AccessToken,
+
});
_updateInfo = new CheckForUpdatesResponse();
@@ -210,17 +209,14 @@ namespace Tango.MachineStudio.UI.ViewModels
var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
- Task.Factory.StartNew(() =>
+ Task.Factory.StartNew((Action)(() =>
{
try
{
Thread.Sleep(2000);
- var client = new MachineStudioWebService();
-
- CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest()
+ CheckForUpdatesResponse response = _machineStudioWebClient.CheckForUpdates(new CheckForUpdatesRequest()
{
- AccessToken = _authentication.AccessToken,
Version = _application.Version.ToString(),
}).Result;
@@ -241,7 +237,7 @@ namespace Tango.MachineStudio.UI.ViewModels
logManager.Log(ex, "Error while checking for version update!");
Status = UpdateStatus.Error;
}
- });
+ }));
}
private void BackToApplication()