From 76f067f86778c29fbfb3716a72bc858cfdd73fd8 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Thu, 21 Feb 2013 16:06:23 -0500 Subject: extracted more logging dependancies --- MediaBrowser.ServerApplication/App.xaml.cs | 20 +++++++++++++++++--- MediaBrowser.ServerApplication/MainWindow.xaml.cs | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'MediaBrowser.ServerApplication') diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs index 768f5ed11..4da5c39fe 100644 --- a/MediaBrowser.ServerApplication/App.xaml.cs +++ b/MediaBrowser.ServerApplication/App.xaml.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.Logging; using MediaBrowser.Common.UI; using MediaBrowser.Controller; using MediaBrowser.IsoMounter; +using MediaBrowser.Model.Logging; using MediaBrowser.Server.Uninstall; using MediaBrowser.ServerApplication.Implementations; using System; @@ -24,7 +25,10 @@ namespace MediaBrowser.ServerApplication [STAThread] public static void Main() { - RunApplication("MediaBrowserServer"); + var application = new App(LogManager.GetLogger("App")); + application.InitializeComponent(); + + application.Run(); } /// @@ -39,6 +43,16 @@ namespace MediaBrowser.ServerApplication } } + /// + /// Initializes a new instance of the class. + /// + /// The logger. + public App(ILogger logger) + : base(logger) + { + + } + /// /// Gets the name of the product. /// @@ -170,7 +184,7 @@ namespace MediaBrowser.ServerApplication /// IKernel. protected override IKernel InstantiateKernel() { - return new Kernel(new PismoIsoManager(LogManager.GetLogger("PismoIsoManager")), new DotNetZipClient(), new BdInfoExaminer()); + return new Kernel(new PismoIsoManager(Logger), new DotNetZipClient(), new BdInfoExaminer(), Logger); } /// @@ -179,7 +193,7 @@ namespace MediaBrowser.ServerApplication /// Window. protected override Window InstantiateMainWindow() { - return new MainWindow(LogManager.GetLogger("MainWindow")); + return new MainWindow(Logger); } } } diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml.cs b/MediaBrowser.ServerApplication/MainWindow.xaml.cs index bce0c4aa0..e020aebf7 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml.cs +++ b/MediaBrowser.ServerApplication/MainWindow.xaml.cs @@ -160,7 +160,7 @@ namespace MediaBrowser.ServerApplication // Show the notification if (newItems.Count == 1) { - Dispatcher.InvokeAsync(() => MbTaskbarIcon.ShowCustomBalloon(new ItemUpdateNotification(LogManager.GetLogger("ItemUpdateNotification")) + Dispatcher.InvokeAsync(() => MbTaskbarIcon.ShowCustomBalloon(new ItemUpdateNotification(_logger) { DataContext = newItems[0] @@ -168,7 +168,7 @@ namespace MediaBrowser.ServerApplication } else if (newItems.Count > 1) { - Dispatcher.InvokeAsync(() => MbTaskbarIcon.ShowCustomBalloon(new MultiItemUpdateNotification(LogManager.GetLogger("ItemUpdateNotification")) + Dispatcher.InvokeAsync(() => MbTaskbarIcon.ShowCustomBalloon(new MultiItemUpdateNotification(_logger) { DataContext = newItems -- cgit v1.2.3