diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-08 00:08:27 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-03-08 00:08:27 -0500 |
| commit | 9911df11e8a96d5d7fffcd8618b63a6adb27701f (patch) | |
| tree | b7e446296c6b0f61804430cd59beda68aa549065 /MediaBrowser.ServerApplication/MainWindow.xaml.cs | |
| parent | 211d24e66e717f6294840b4f91806a24c1fb2e78 (diff) | |
extracted provider manager. took more off the kernel
Diffstat (limited to 'MediaBrowser.ServerApplication/MainWindow.xaml.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/MainWindow.xaml.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml.cs b/MediaBrowser.ServerApplication/MainWindow.xaml.cs index 80f959b8b..364dd9da6 100644 --- a/MediaBrowser.ServerApplication/MainWindow.xaml.cs +++ b/MediaBrowser.ServerApplication/MainWindow.xaml.cs @@ -4,6 +4,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; +using MediaBrowser.Model.Serialization; using MediaBrowser.ServerApplication.Logging; using System; using System.ComponentModel; @@ -38,7 +39,11 @@ namespace MediaBrowser.ServerApplication /// The _configuration manager /// </summary> private readonly IServerConfigurationManager _configurationManager; - + + private readonly IUserManager _userManager; + private readonly ILibraryManager _libraryManager; + private readonly IJsonSerializer _jsonSerializer; + /// <summary> /// Initializes a new instance of the <see cref="MainWindow" /> class. /// </summary> @@ -46,7 +51,7 @@ namespace MediaBrowser.ServerApplication /// <param name="logger">The logger.</param> /// <param name="appHost">The app host.</param> /// <exception cref="System.ArgumentNullException">logger</exception> - public MainWindow(ILogManager logManager, IApplicationHost appHost, IServerConfigurationManager configurationManager) + public MainWindow(ILogManager logManager, IApplicationHost appHost, IServerConfigurationManager configurationManager, IUserManager userManager, ILibraryManager libraryManager, IJsonSerializer jsonSerializer) { if (logManager == null) { @@ -65,6 +70,9 @@ namespace MediaBrowser.ServerApplication _appHost = appHost; _logManager = logManager; _configurationManager = configurationManager; + _userManager = userManager; + _libraryManager = libraryManager; + _jsonSerializer = jsonSerializer; InitializeComponent(); @@ -209,8 +217,7 @@ namespace MediaBrowser.ServerApplication /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void cmOpenExplorer_click(object sender, RoutedEventArgs e) { - var explorer = (LibraryExplorer)_appHost.CreateInstance(typeof(LibraryExplorer)); - explorer.Show(); + new LibraryExplorer(_jsonSerializer, _logger, _appHost, _userManager, _libraryManager).Show(); } /// <summary> @@ -220,7 +227,7 @@ namespace MediaBrowser.ServerApplication /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void cmOpenDashboard_click(object sender, RoutedEventArgs e) { - var user = _appHost.Resolve<IUserManager>().Users.FirstOrDefault(u => u.Configuration.IsAdministrator); + var user = _userManager.Users.FirstOrDefault(u => u.Configuration.IsAdministrator); OpenDashboard(user); } @@ -249,7 +256,7 @@ namespace MediaBrowser.ServerApplication /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void cmdBrowseLibrary_click(object sender, RoutedEventArgs e) { - var user = _appHost.Resolve<IUserManager>().Users.FirstOrDefault(u => u.Configuration.IsAdministrator); + var user = _userManager.Users.FirstOrDefault(u => u.Configuration.IsAdministrator); App.OpenDashboardPage("index.html", user, _configurationManager); } |
