diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-28 11:42:21 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-28 11:42:21 +0200 |
| commit | c726e1f7697d9f0fe8cff387dc64dd00c4980b82 (patch) | |
| tree | 52d91153ee05a32a8ffcd42c4a9220cb7a517bca /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs | |
| parent | 2f70caaf340063f90529c3302f2f2a78dda9d40c (diff) | |
| download | Tango-c726e1f7697d9f0fe8cff387dc64dd00c4980b82.tar.gz Tango-c726e1f7697d9f0fe8cff387dc64dd00c4980b82.zip | |
Change LogManager to Instance.
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.cs | 19 |
1 files changed, 10 insertions, 9 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 6be4ba4ca..ab4fd8e0b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -38,6 +38,7 @@ namespace Tango.MachineStudio.UI.ViewModels public class UpdateViewVM : ViewModel { private String _appPath = AppDomain.CurrentDomain.BaseDirectory; + private LogManager logManager = LogManager.Default; private INotificationProvider _notification; private INavigationManager _navigation; @@ -147,7 +148,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error while checking for version update!"); + logManager.Log(ex, "Error while checking for version update!"); Status = UpdateStatus.Error; } finally @@ -187,7 +188,7 @@ namespace Tango.MachineStudio.UI.ViewModels try { - LogManager.Log("Creating temporary file " + tempFile); + logManager.Log("Creating temporary file " + tempFile); int fileSize = 0; @@ -202,12 +203,12 @@ namespace Tango.MachineStudio.UI.ViewModels { using (FtpClient ftp = new FtpClient(_updateInfo.FtpHost, _updateInfo.UserName, _updateInfo.Password)) { - LogManager.Log("Connecting to FTP site: " + _updateInfo.FtpHost); + logManager.Log("Connecting to FTP site: " + _updateInfo.FtpHost); ftp.ConnectAsync().Wait(); - LogManager.Log("Retrieving download size..."); + logManager.Log("Retrieving download size..."); fileSize = (int)ftp.GetFileSize(_updateInfo.FilePath); - LogManager.Log("Download size: " + fileSize + " bytes."); - LogManager.Log("Starting download..."); + logManager.Log("Download size: " + fileSize + " bytes."); + logManager.Log("Starting download..."); ftp.DownloadAsync(fs, _updateInfo.FilePath).Wait(); } } @@ -225,7 +226,7 @@ namespace Tango.MachineStudio.UI.ViewModels { if (args.EventType == ZipProgressEventType.Extracting_AfterExtractEntry) { - LogManager.Log("Extracting " + Path.GetFileName(args.CurrentEntry.FileName)); + logManager.Log("Extracting " + Path.GetFileName(args.CurrentEntry.FileName)); UpdateProgress = ((double)(currentEntry++) / (double)zip.Entries.Count) * 100d; } }; @@ -250,7 +251,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch { - LogManager.Log("Could not extract file " + entry.FileName); + logManager.Log("Could not extract file " + entry.FileName); } } } @@ -260,7 +261,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error while extracting update package."); + logManager.Log(ex, "Error while extracting update package."); Status = UpdateStatus.Error; } finally |
