diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:43 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-12-20 15:07:43 +0200 |
| commit | 64367a944ebddc998b06eb2673928ef95ffc3627 (patch) | |
| tree | b30eff3671d388d23c10a91a82cc25a6d42d548f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 4554080793bd46fcb8f55578d2f67917584dc332 (diff) | |
| parent | d204e56c57dcf52f31c9e64222f32a678150e721 (diff) | |
| download | Tango-64367a944ebddc998b06eb2673928ef95ffc3627.tar.gz Tango-64367a944ebddc998b06eb2673928ef95ffc3627.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
5 files changed, 23 insertions, 40 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index c311df44b..2b58baa21 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("3.5.79.18305")] +[assembly: AssemblyVersion("3.5.80.18305")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index b3926190f..d3c22341d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -69,6 +69,7 @@ <Reference Include="MaterialDesignThemes.Wpf, Version=2.3.1.953, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll</HintPath> </Reference> + <Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath> </Reference> @@ -609,7 +610,7 @@ copy /Y "$(SolutionDir)Referenced Assemblies\Microsoft.WITDataStore32.dll" "$(Ta </Target> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_BuildVersioningStyle="None.None.Increment.DeltaBaseYearDayOfYear" BuildVersion_UpdateFileVersion="True" BuildVersion_DetectChanges="True" BuildVersion_UseGlobalSettings="False" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file 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 4032c946c..545d51ef2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -69,6 +69,9 @@ namespace Tango.MachineStudio.UI.ViewModels _notificationProvider = notificationProvider; } + /// <summary> + /// Called when the application has been started + /// </summary> public override void OnApplicationStarted() { base.OnApplicationStarted(); @@ -91,15 +94,15 @@ namespace Tango.MachineStudio.UI.ViewModels Status = "Checking for critical updates..."; LogManager.Log("Checking for forced update..."); - var service = UpdateServiceHelper.GetUpdateServiceChannel(); - var client = service.CreateChannel(); + + var client = new MachineStudioUpdateService(); CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() { Email = "ForceUpdate", Password = "ForceUpdate", Version = ApplicationManager.Version.ToString(), - }); + }).Result; if (response.IsUpdateAvailable && response.ForcedUpdate) { 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 c9cd3276f..befad162c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -359,8 +359,7 @@ namespace Tango.MachineStudio.UI.ViewModels { if (_authenticationProvider.CurrentUser != null) { - var service = UpdateServiceHelper.GetUpdateServiceChannel(); - var client = service.CreateChannel(); + var client = new MachineStudioUpdateService(); CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() { @@ -368,7 +367,7 @@ namespace Tango.MachineStudio.UI.ViewModels Password = _authenticationProvider.CurrentUser.Password, Version = _applicationManager.Version.ToString(), AcceptBetaRelease = _settings.AcceptBetaRelease, - }); + }).Result; IsUpdateAvailable = response.IsUpdateAvailable; LatestVersion = response.Version; 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 a9624da2d..3fec96629 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -24,6 +24,7 @@ using Tango.SharedUI; using Tango.MachineStudio.UI.Messages; using Tango.Settings; using Tango.MachineStudio.Common; +using Tango.Transport.Web; namespace Tango.MachineStudio.UI.ViewModels { @@ -185,16 +186,13 @@ namespace Tango.MachineStudio.UI.ViewModels var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); - ChannelFactory<IMachineStudioUpdateService> service = null; - Task.Factory.StartNew(() => { try { Thread.Sleep(2000); - service = UpdateServiceHelper.GetUpdateServiceChannel(); - var client = service.CreateChannel(); + var client = new MachineStudioUpdateService(); CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() { @@ -202,7 +200,7 @@ namespace Tango.MachineStudio.UI.ViewModels Password = _authentication.CurrentUser.Password, Version = _application.Version.ToString(), AcceptBetaRelease = settings.AcceptBetaRelease, - }); + }).Result; if (response.IsUpdateAvailable) { @@ -221,13 +219,6 @@ namespace Tango.MachineStudio.UI.ViewModels logManager.Log(ex, "Error while checking for version update!"); Status = UpdateStatus.Error; } - finally - { - if (service != null) - { - service.Close(); - } - } }); } @@ -260,29 +251,18 @@ namespace Tango.MachineStudio.UI.ViewModels { logManager.Log("Creating temporary file " + tempFile); - int fileSize = 0; - - using (FileStreamWrapper fs = new FileStreamWrapper(tempFile.Path, FileMode.Create, (current) => + using (StorageBlobDownloader downloader = new StorageBlobDownloader(_updateInfo.BlobAddress, tempFile.Path)) { - InvokeUINow(() => + downloader.Progress += (x, e) => { - Thread.Sleep(10); - DownloadProgress = ((double)current / (double)fileSize) * 100d; - }); - })) - { - using (FtpClient ftp = new FtpClient(_updateInfo.FtpHost, _updateInfo.UserName, _updateInfo.Password)) - { - logManager.Log("Connecting to FTP site: " + _updateInfo.FtpHost); - ftp.ConnectAsync().Wait(); - logManager.Log("Retrieving download size..."); - fileSize = (int)ftp.GetFileSize(_updateInfo.FilePath); - logManager.Log("Download size: " + fileSize + " bytes."); - logManager.Log("Starting download..."); - ftp.DownloadAsync(fs, _updateInfo.FilePath).Wait(); - } - } + InvokeUINow(() => + { + DownloadProgress = ((double)e.Current / (double)e.Total) * 100d; + }); + }; + downloader.Download().Wait(); + } Status = UpdateStatus.Updating; |
