diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-18 16:38:02 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-18 16:38:02 -0400 |
| commit | 59a3dcc8c1c6b41560bd48507cfcf4f0ca0a8862 (patch) | |
| tree | 895b181503897c3e02a6d35b7b05321e65492af5 /MediaBrowser.Common/Kernel/BaseKernel.cs | |
| parent | a508a997d9e7605c40f4442e367b9dd74e54f5e3 (diff) | |
Slight re-work of ApplicationPaths so that we can have inherited versions for the UI and Server
Diffstat (limited to 'MediaBrowser.Common/Kernel/BaseKernel.cs')
| -rw-r--r-- | MediaBrowser.Common/Kernel/BaseKernel.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 6e24fcfc2..ecfe11e2c 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -18,14 +18,17 @@ namespace MediaBrowser.Common.Kernel /// <summary>
/// Represents a shared base kernel for both the UI and server apps
/// </summary>
- public abstract class BaseKernel<TConfigurationType> : IDisposable
+ public abstract class BaseKernel<TConfigurationType, TApplicationPathsType> : IDisposable
where TConfigurationType : BaseApplicationConfiguration, new()
+ where TApplicationPathsType : BaseApplicationPaths, new()
{
/// <summary>
/// Gets the current configuration
/// </summary>
public TConfigurationType Configuration { get; private set; }
+ public TApplicationPathsType ApplicationPaths { get; private set; }
+
/// <summary>
/// Gets the list of currently loaded plugins
/// </summary>
@@ -45,7 +48,7 @@ namespace MediaBrowser.Common.Kernel public BaseKernel()
{
-
+ ApplicationPaths = new TApplicationPathsType();
}
public virtual void Init(IProgress<TaskProgress> progress)
@@ -149,13 +152,13 @@ namespace MediaBrowser.Common.Kernel //Configuration information for anything other than server-specific configuration will have to come via the API... -ebr
// Deserialize config
- if (!File.Exists(ApplicationPaths.ConfigurationPath))
+ if (!File.Exists(ApplicationPaths.SystemConfigurationFilePath))
{
Configuration = new TConfigurationType();
}
else
{
- Configuration = JsonSerializer.DeserializeFromFile<TConfigurationType>(ApplicationPaths.ConfigurationPath);
+ Configuration = XmlSerializer.DeserializeFromFile<TConfigurationType>(ApplicationPaths.SystemConfigurationFilePath);
}
Logger.LoggerInstance.LogSeverity = Configuration.LogSeverity;
|
