From 4e79eaf65e8edb895f9337a8b878ff9ef312b3f6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 4 Dec 2013 09:52:38 -0500 Subject: add ApplicationPath to app paths interface to hide implementation --- .../BaseApplicationHost.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'MediaBrowser.Common.Implementations/BaseApplicationHost.cs') diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs index becf649f4..e8f4d51eb 100644 --- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs +++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs @@ -33,7 +33,7 @@ namespace MediaBrowser.Common.Implementations /// /// The type of the T application paths type. public abstract class BaseApplicationHost : IApplicationHost - where TApplicationPathsType : class, IApplicationPaths, new() + where TApplicationPathsType : class, IApplicationPaths { /// /// Occurs when [has pending restart changed]. @@ -83,7 +83,7 @@ namespace MediaBrowser.Common.Implementations /// /// The json serializer /// - public readonly IJsonSerializer JsonSerializer = new JsonSerializer(); + public IJsonSerializer JsonSerializer { get; private set; } /// /// The _XML serializer @@ -153,7 +153,7 @@ namespace MediaBrowser.Common.Implementations protected IInstallationManager InstallationManager { get; private set; } protected IFileSystem FileSystemManager { get; private set; } - + /// /// Gets or sets the zip client. /// @@ -181,6 +181,8 @@ namespace MediaBrowser.Common.Implementations /// Task. public virtual async Task Init() { + JsonSerializer = CreateJsonSerializer(); + IsFirstRun = !ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted; Logger = LogManager.GetLogger("App"); @@ -212,6 +214,11 @@ namespace MediaBrowser.Common.Implementations } + protected virtual IJsonSerializer CreateJsonSerializer() + { + return new JsonSerializer(); + } + private void SetHttpLimit() { try @@ -224,7 +231,7 @@ namespace MediaBrowser.Common.Implementations Logger.ErrorException("Error setting http limit", ex); } } - + /// /// Installs the iso mounters. /// -- cgit v1.2.3