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 | |
| 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')
8 files changed, 23 insertions, 15 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index b6a131d22..15158f87b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -19,6 +19,7 @@ namespace Tango.MachineStudio.UI public partial class App : Application { private WpfGlobalExceptionTrapper exceptionTrapper; + private LogManager LogManager = LogManager.Default; protected override void OnStartup(StartupEventArgs e) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index 15c8abcde..36ee95f10 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -26,6 +26,7 @@ namespace Tango.MachineStudio.UI public partial class MainWindow : MetroWindow { public static MainWindow Instance { get; set; } + private LogManager LogManager = LogManager.Default; public MainWindow() { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs index 5951137e3..1640af940 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -29,6 +29,7 @@ namespace Tango.MachineStudio.UI.Modules private IAuthenticationProvider _authenticationProvider; private bool _loaded; public event EventHandler ModulesLoaded; + private LogManager LogManager = LogManager.Default; /// <summary> /// Initializes a new instance of the <see cref="DefaultStudioModuleLoader"/> class. diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 9538c59af..e80b31e23 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -31,6 +31,7 @@ namespace Tango.MachineStudio.UI.StudioApplication private INavigationManager _navigationManager; private IStudioModuleLoader _moduleLoader; private List<Window> _openedWindows; + private LogManager LogManager = LogManager.Default; /// <summary> /// Initializes a new instance of the <see cref="DefaultStudioApplicationManager" /> class. diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs index 330bcd6eb..675022276 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModelLocator.cs @@ -29,6 +29,8 @@ namespace Tango.MachineStudio.UI /// </summary> public class ViewModelLocator { + private LogManager LogManager = LogManager.Default; + /// <summary> /// Initializes a new instance of the ViewModelLocator class. /// </summary> 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 9acf26afd..f181ebb45 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -24,7 +24,7 @@ namespace Tango.MachineStudio.UI.ViewModels private INotificationProvider _notificationProvider; private INavigationManager _navigationManager; private IStudioModuleLoader _studioModuleLoader; - + private LogManager logManager = LogManager.Default; public IStudioApplicationManager ApplicationManager { get; set; } /// <summary> @@ -60,7 +60,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex); + logManager.Log(ex); InvokeUINow(() => { 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 fb2cd5c82..57f1d704c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -42,6 +42,7 @@ namespace Tango.MachineStudio.UI.ViewModels private INavigationManager _navigation; private bool _isDisconnecting; private Thread _updateCheckThread; + private LogManager logManager = LogManager.Default; /// <summary> /// Gets or sets the current loaded module. @@ -248,7 +249,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error in version update periodic check..."); + logManager.Log(ex, "Error in version update periodic check..."); } Thread.Sleep(TimeSpan.FromMinutes(4)); @@ -322,7 +323,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex); + logManager.Log(ex); _notificationProvider.ShowError(ex.Message); } @@ -341,7 +342,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex); + logManager.Log(ex); _notificationProvider.ShowError(ex.Message); } @@ -435,7 +436,7 @@ namespace Tango.MachineStudio.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error popping out module " + module.Name); + logManager.Log(ex, "Error popping out module " + module.Name); _notificationProvider.ShowError("Error popping out module " + module.Name); } } 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 |
